Cleanup _.compose.

This commit is contained in:
John-David Dalton
2014-06-24 20:51:40 -07:00
parent 1241fb54f3
commit 3a221f9b6e

View File

@@ -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;
}; };