Avoid variable assignments in return statements.

This commit is contained in:
John-David Dalton
2014-05-20 21:45:45 -07:00
parent 76828a87ee
commit 9525952573
2 changed files with 44 additions and 27 deletions

View File

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