mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Avoid variable assignments in return statements.
This commit is contained in:
24
lodash.js
24
lodash.js
@@ -1818,7 +1818,8 @@
|
||||
|
||||
if (isWhere) {
|
||||
while (index--) {
|
||||
if ((result = baseIsEqual(value[index], othValue, callback, isWhere, stackA, stackB))) {
|
||||
result = baseIsEqual(value[index], othValue, callback, isWhere, stackA, stackB);
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1858,7 +1859,8 @@
|
||||
baseForIn(value, function(valValue, key, value) {
|
||||
if (hasOwnProperty.call(value, key)) {
|
||||
// `size` will be `-1` if `value` has more properties than `other`
|
||||
return (result = --size > -1);
|
||||
result = --size > -1;
|
||||
return result;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -4049,7 +4051,8 @@
|
||||
}
|
||||
} else {
|
||||
baseEach(collection, function(value, index, collection) {
|
||||
return (result = !!predicate(value, index, collection));
|
||||
result = !!predicate(value, index, collection);
|
||||
return result;
|
||||
});
|
||||
}
|
||||
return result;
|
||||
@@ -4947,7 +4950,8 @@
|
||||
}
|
||||
} else {
|
||||
baseEach(collection, function(value, index, collection) {
|
||||
return !(result = predicate(value, index, collection));
|
||||
result = predicate(value, index, collection);
|
||||
return !result;
|
||||
});
|
||||
}
|
||||
return !!result;
|
||||
@@ -6449,7 +6453,8 @@
|
||||
return !length;
|
||||
}
|
||||
baseForOwn(value, function() {
|
||||
return (result = false);
|
||||
result = false;
|
||||
return result;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
@@ -8059,15 +8064,14 @@
|
||||
if (length && !object) {
|
||||
return false;
|
||||
}
|
||||
var result = true;
|
||||
while (length--) {
|
||||
var key = props[length];
|
||||
if (!(result = hasOwnProperty.call(object, key) &&
|
||||
baseIsEqual(object[key], source[key], null, true))) {
|
||||
break;
|
||||
if (!(hasOwnProperty.call(object, key) &&
|
||||
baseIsEqual(object[key], source[key], null, true))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user