aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Chapman2013-03-19 15:10:04 +0000
committerIgor Minar2013-04-04 08:59:19 -0700
commit5ecd6d4e0ac261cad8cec4f6e299c191fed6c692 (patch)
tree6c2cdae053c8f86ceaa96b2c6bbc813f0b6418e2
parent03bbe9aab1cec0b0a8fe6ddd7320dd28fd3795bc (diff)
downloadangular.js-5ecd6d4e0ac261cad8cec4f6e299c191fed6c692.tar.bz2
refactor(ngRepeat): make use of declared variable
Rename unused arrayLength variable to arrayBound and use it inside loop
-rw-r--r--src/ng/directive/ngRepeat.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js
index c59fefac..ea96d0ad 100644
--- a/src/ng/directive/ngRepeat.js
+++ b/src/ng/directive/ngRepeat.js
@@ -96,7 +96,7 @@ var ngRepeatDirective = ngDirective({
// Same as lastOrder but it has the current state. It will become the
// lastOrder on the next iteration.
nextOrder = new HashQueueMap(),
- arrayLength,
+ arrayBound,
childScope,
key, value, // key/value of iteration
array,
@@ -117,7 +117,7 @@ var ngRepeatDirective = ngDirective({
array = collection || [];
}
- arrayLength = array.length;
+ arrayBound = array.length-1;
// we are not using forEach for perf reasons (trying to avoid #call)
for (index = 0, length = array.length; index < length; index++) {
@@ -154,7 +154,7 @@ var ngRepeatDirective = ngDirective({
childScope.$index = index;
childScope.$first = (index === 0);
- childScope.$last = (index === (arrayLength - 1));
+ childScope.$last = (index === arrayBound);
childScope.$middle = !(childScope.$first || childScope.$last);
if (!last) {