mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Cleanup _.merge.
Former-commit-id: 4227c403f89a1085ce88ca992106b7ed0a3c210c
This commit is contained in:
@@ -1774,15 +1774,12 @@
|
||||
// avoid merging previously merged cyclic sources
|
||||
var stackLength = stackA.length;
|
||||
while (stackLength--) {
|
||||
found = stackA[stackLength] == source;
|
||||
if (found) {
|
||||
if ((found = stackA[stackLength] == source)) {
|
||||
object[key] = stackB[stackLength];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
object[key] = stackB[stackLength];
|
||||
}
|
||||
else {
|
||||
if (!found) {
|
||||
// add `source` and associated `value` to the stack of traversed objects
|
||||
stackA.push(source);
|
||||
stackB.push(value = (value = object[key], isArr)
|
||||
|
||||
Reference in New Issue
Block a user