From 42d5cc584eceac1cb20013140f32b27494044d26 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 3 Dec 2015 22:44:51 -0800 Subject: [PATCH] Simplify iteration in `createBaseFor` . --- lodash.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lodash.js b/lodash.js index fe79ab633..364524ea0 100644 --- a/lodash.js +++ b/lodash.js @@ -3912,13 +3912,13 @@ */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { - var iterable = Object(object), + var index = -1, + iterable = Object(object), props = keysFunc(object), - length = props.length, - index = fromRight ? length : -1; + length = props.length; - while ((fromRight ? index-- : ++index < length)) { - var key = props[index]; + while (length--) { + var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; }