]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
modified the loop
authorChristopher De Cairos <chris.decairos@gmail.com>
Wed, 1 Jun 2011 22:35:04 +0000 (18:35 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Wed, 1 Jun 2011 22:35:04 +0000 (18:35 -0400)
popcorn.js

index 5945134dea274045d96cc0cc361b2fe2cdd2fdac..c25c08b1bc4cdd5db31b46939e95e2afc362beff 100644 (file)
   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;
       }