mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Reuse length var in _.compose.
This commit is contained in:
10
lodash.js
10
lodash.js
@@ -5692,7 +5692,7 @@
|
|||||||
function compose() {
|
function compose() {
|
||||||
var funcs = arguments,
|
var funcs = arguments,
|
||||||
length = funcs.length,
|
length = funcs.length,
|
||||||
fromIndex = length - 1;
|
index = length - 1;
|
||||||
|
|
||||||
if (!length) {
|
if (!length) {
|
||||||
return function() {};
|
return function() {};
|
||||||
@@ -5703,11 +5703,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return function() {
|
return function() {
|
||||||
var index = fromIndex,
|
length = index;
|
||||||
result = funcs[index].apply(this, arguments);
|
var result = funcs[length].apply(this, arguments);
|
||||||
|
|
||||||
while (index--) {
|
while (length--) {
|
||||||
result = funcs[index].call(this, result);
|
result = funcs[length].call(this, result);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user