Skip to content

Commit

Permalink
perf(document): remove unnecessary workaround for ignoring subpaths o…
Browse files Browse the repository at this point in the history
…f arrays

Re: #11541
  • Loading branch information
vkarpov15 committed May 1, 2022
1 parent f7fe2c7 commit be9f3df
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -1639,14 +1639,6 @@ Document.prototype.$__set = function(pathToMark, path, options, constructing, pa
item && item.__parentArray && (item.__parentArray = val);
});
}

// Small hack for gh-1638: if we're overwriting the entire array, ignore
// paths that were modified before the array overwrite
this.$__.activePaths.forEach(function(modifiedPath) {
if (modifiedPath.startsWith(path + '.')) {
_this.$__.activePaths.ignore(modifiedPath);
}
});
}
} else if (Array.isArray(val) && Array.isArray(priorVal) && utils.isMongooseArray(val) && utils.isMongooseArray(priorVal)) {
val[arrayAtomicsSymbol] = priorVal[arrayAtomicsSymbol];
Expand Down

0 comments on commit be9f3df

Please sign in to comment.