Deleting unnecessary Differentiator code

Summary:
In the new Flattening differ, I experimentally verified that these two code paths are not hit (or redundant) and deleted them.

One of the branches did nothing and the other produced duplicate DELETE mutations for the same tag, that is handled elsewhere.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23806161

fbshipit-source-id: 9ad2929e2d719a7b9b34640ed35f7a696103604b
This commit is contained in:
Joshua Gross
2020-09-20 14:54:00 -07:00
committed by Facebook GitHub Bot
parent e1b63ae17e
commit df9ada5fb7
@@ -1076,11 +1076,7 @@ static void calculateShadowViewMutationsV2(
for (auto &oldFlattenedNode : oldFlattenedNodes) {
auto unvisitedOldChildPairIt = unvisitedOldChildPairs.find(
oldFlattenedNode.shadowView.tag);
if (unvisitedOldChildPairIt != unvisitedOldChildPairs.end()) {
// Node unvisited - delete it entirely
deleteMutations.push_back(ShadowViewMutation::DeleteMutation(
oldFlattenedNode.shadowView));
} else {
if (unvisitedOldChildPairIt == unvisitedOldChildPairs.end()) {
// Node was visited - make sure to remove it from
// "newRemainingPairs" map
auto newRemainingIt =
@@ -1202,11 +1198,7 @@ static void calculateShadowViewMutationsV2(
for (auto &oldFlattenedNode : oldFlattenedNodes) {
auto unvisitedOldChildPairIt = unvisitedOldChildPairs.find(
oldFlattenedNode.shadowView.tag);
if (unvisitedOldChildPairIt != unvisitedOldChildPairs.end()) {
// Node unvisited - delete it entirely
deleteMutations.push_back(ShadowViewMutation::DeleteMutation(
oldFlattenedNode.shadowView));
} else {
if (unvisitedOldChildPairIt == unvisitedOldChildPairs.end()) {
// Node was visited - make sure to remove it from
// "newRemainingPairs" map
auto newRemainingIt =