From 30f256aad2bfa0d5cff39f11448f6ed1aa8976e3 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 9 Jul 2014 00:41:58 -0700 Subject: [PATCH] Reuse `length` var in `_.compose`. --- lodash.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lodash.js b/lodash.js index ad4b8a80b..cd74fc788 100644 --- a/lodash.js +++ b/lodash.js @@ -5692,7 +5692,7 @@ function compose() { var funcs = arguments, length = funcs.length, - fromIndex = length - 1; + index = length - 1; if (!length) { return function() {}; @@ -5703,11 +5703,11 @@ } } return function() { - var index = fromIndex, - result = funcs[index].apply(this, arguments); + length = index; + var result = funcs[length].apply(this, arguments); - while (index--) { - result = funcs[index].call(this, result); + while (length--) { + result = funcs[length].call(this, result); } return result; };