Cleanup _.merge.

Former-commit-id: 4227c403f89a1085ce88ca992106b7ed0a3c210c
This commit is contained in:
John-David Dalton
2013-01-12 13:47:13 -08:00
parent fb9d4303f1
commit ce33af6bb5

View File

@@ -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)