From: Christopher De Cairos Date: Wed, 1 Jun 2011 22:35:04 +0000 (-0400) Subject: modified the loop X-Git-Tag: v0.7^2~53^2~8 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=b06a3bf667d7966e3188390c7e884507b6a07822;p=popcorn-js.git modified the loop --- diff --git a/popcorn.js b/popcorn.js index 5945134..c25c08b 100644 --- a/popcorn.js +++ b/popcorn.js @@ -779,10 +779,10 @@ Popcorn.getTrackEvent = function( obj, trackId ) { var byStart = obj.data.trackEvents.byStart, - len = byStart.length, i; + len = byStart.length; - for (i = 0; i < len; i++) { - o = byStart[i]; + while ( len-- ) { + o = byStart[len]; if ( o._id === trackId ) { return o; }