mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Simplify iteration in createBaseFor .
This commit is contained in:
10
lodash.js
10
lodash.js
@@ -3912,13 +3912,13 @@
|
|||||||
*/
|
*/
|
||||||
function createBaseFor(fromRight) {
|
function createBaseFor(fromRight) {
|
||||||
return function(object, iteratee, keysFunc) {
|
return function(object, iteratee, keysFunc) {
|
||||||
var iterable = Object(object),
|
var index = -1,
|
||||||
|
iterable = Object(object),
|
||||||
props = keysFunc(object),
|
props = keysFunc(object),
|
||||||
length = props.length,
|
length = props.length;
|
||||||
index = fromRight ? length : -1;
|
|
||||||
|
|
||||||
while ((fromRight ? index-- : ++index < length)) {
|
while (length--) {
|
||||||
var key = props[index];
|
var key = props[fromRight ? length : ++index];
|
||||||
if (iteratee(iterable[key], key, iterable) === false) {
|
if (iteratee(iterable[key], key, iterable) === false) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user