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