Differ: simplify flatten/unflatten logic
Summary: Since each ShadowViewNodePair will point to any matched pair in the "other" tree during diffing, we can rely on the presence of the "other" pointer instead of always removing nodes from `deletionCreationCandidatePairs` when they're matched. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003335 fbshipit-source-id: 0b886946eedc497091ca79c436f160b3d4bf3f1e
This commit is contained in:
Родитель
6e13040ecb
Коммит
08a1531a1f
|
@ -854,21 +854,6 @@ static void calculateShadowViewMutationsFlattener(
|
|||
oldTreeNodePair,
|
||||
subVisitedNewMap,
|
||||
subVisitedOldMap);
|
||||
|
||||
for (auto newFlattenedNode : newFlattenedNodes) {
|
||||
auto unvisitedOldChildPairIt =
|
||||
unvisitedNewChildPairs.find(newFlattenedNode->shadowView.tag);
|
||||
|
||||
if (unvisitedOldChildPairIt == unvisitedNewChildPairs.end()) {
|
||||
// Node was visited.
|
||||
|
||||
auto deleteCreateIt = deletionCreationCandidatePairs.find(
|
||||
newFlattenedNode->shadowView.tag);
|
||||
if (deleteCreateIt != deletionCreationCandidatePairs.end()) {
|
||||
deletionCreationCandidatePairs.erase(deleteCreateIt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Flatten parent, unflatten child
|
||||
else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче