@@ -310,13 +310,13 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
310
310
// Same as lastBlockMap but it has the current state. It will become the
311
311
// lastBlockMap on the next iteration.
312
312
nextBlockMap = createMap ( ) ,
313
- arrayLength ,
313
+ collectionLength ,
314
314
key , value , // key/value of iteration
315
315
trackById ,
316
316
trackByIdFn ,
317
317
collectionKeys ,
318
318
block , // last object information {scope, element, id}
319
- nextBlockOrder = [ ] ,
319
+ nextBlockOrder ,
320
320
elementsToRemove ;
321
321
322
322
if ( aliasAs ) {
@@ -338,11 +338,11 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
338
338
collectionKeys . sort ( ) ;
339
339
}
340
340
341
- arrayLength = collectionKeys . length ;
341
+ collectionLength = collectionKeys . length ;
342
+ nextBlockOrder = new Array ( collectionLength ) ;
342
343
343
344
// locate existing items
344
- length = nextBlockOrder . length = collectionKeys . length ;
345
- for ( index = 0 ; index < length ; index ++ ) {
345
+ for ( index = 0 ; index < collectionLength ; index ++ ) {
346
346
key = ( collection === collectionKeys ) ? index : collectionKeys [ index ] ;
347
347
value = collection [ key ] ;
348
348
trackById = trackByIdFn ( key , value , index ) ;
@@ -382,7 +382,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
382
382
}
383
383
384
384
// we are not using forEach for perf reasons (trying to avoid #call)
385
- for ( index = 0 , length = collectionKeys . length ; index < length ; index ++ ) {
385
+ for ( index = 0 ; index < collectionLength ; index ++ ) {
386
386
key = ( collection === collectionKeys ) ? index : collectionKeys [ index ] ;
387
387
value = collection [ key ] ;
388
388
block = nextBlockOrder [ index ] ;
@@ -401,7 +401,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
401
401
$animate . move ( getBlockNodes ( block . clone ) , null , jqLite ( previousNode ) ) ;
402
402
}
403
403
previousNode = getBlockEnd ( block ) ;
404
- updateScope ( block . scope , index , valueIdentifier , value , keyIdentifier , key , arrayLength ) ;
404
+ updateScope ( block . scope , index , valueIdentifier , value , keyIdentifier , key , collectionLength ) ;
405
405
} else {
406
406
// new item which we don't know about
407
407
$transclude ( function ngRepeatTransclude ( clone , scope ) {
@@ -415,7 +415,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
415
415
// by a directive with templateUrl when its template arrives.
416
416
block . clone = clone ;
417
417
nextBlockMap [ block . id ] = block ;
418
- updateScope ( block . scope , index , valueIdentifier , value , keyIdentifier , key , arrayLength ) ;
418
+ updateScope ( block . scope , index , valueIdentifier , value , keyIdentifier , key , collectionLength ) ;
419
419
} ) ;
420
420
}
421
421
}
0 commit comments