mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Cleanup _.compose.
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -5388,8 +5388,8 @@
|
|||||||
*/
|
*/
|
||||||
function compose() {
|
function compose() {
|
||||||
var funcs = arguments,
|
var funcs = arguments,
|
||||||
funcsLength = funcs.length,
|
length = funcs.length,
|
||||||
length = funcsLength;
|
fromIndex = length - 1;
|
||||||
|
|
||||||
if (!length) {
|
if (!length) {
|
||||||
return function() {};
|
return function() {};
|
||||||
@@ -5400,11 +5400,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return function() {
|
return function() {
|
||||||
var length = funcsLength - 1,
|
var index = fromIndex,
|
||||||
result = funcs[length].apply(this, arguments);
|
result = funcs[index].apply(this, arguments);
|
||||||
|
|
||||||
while (length--) {
|
while (index--) {
|
||||||
result = funcs[length].call(this, result);
|
result = funcs[index].call(this, result);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user