diff --git a/ReactCommon/fabric/mounting/Differentiator.cpp b/ReactCommon/fabric/mounting/Differentiator.cpp index 2f8a932c6bf..62bf19d1229 100644 --- a/ReactCommon/fabric/mounting/Differentiator.cpp +++ b/ReactCommon/fabric/mounting/Differentiator.cpp @@ -39,7 +39,7 @@ static void sliceChildShadowNodeViewPairsRecursively( *childShadowNode); } else { shadowView.layoutMetrics.frame.origin += layoutOffset; - pairList.push_back({shadowView, *childShadowNode}); + pairList.push_back({shadowView, childShadowNode.get()}); } } } @@ -98,9 +98,9 @@ static void calculateShadowViewMutations( } const auto oldGrandChildPairs = - sliceChildShadowNodeViewPairs(oldChildPair.shadowNode); + sliceChildShadowNodeViewPairs(*oldChildPair.shadowNode); const auto newGrandChildPairs = - sliceChildShadowNodeViewPairs(newChildPair.shadowNode); + sliceChildShadowNodeViewPairs(*newChildPair.shadowNode); calculateShadowViewMutations( *(newGrandChildPairs.size() ? &downwardMutations : &destructiveDownwardMutations), @@ -145,7 +145,7 @@ static void calculateShadowViewMutations( calculateShadowViewMutations( destructiveDownwardMutations, oldChildPair.shadowView, - sliceChildShadowNodeViewPairs(oldChildPair.shadowNode), + sliceChildShadowNodeViewPairs(*oldChildPair.shadowNode), {}); } else { // The old view *was* (re)inserted. @@ -154,9 +154,9 @@ static void calculateShadowViewMutations( const auto &newChildPair = it->second; if (newChildPair.shadowView != oldChildPair.shadowView) { const auto oldGrandChildPairs = - sliceChildShadowNodeViewPairs(oldChildPair.shadowNode); + sliceChildShadowNodeViewPairs(*oldChildPair.shadowNode); const auto newGrandChildPairs = - sliceChildShadowNodeViewPairs(newChildPair.shadowNode); + sliceChildShadowNodeViewPairs(*newChildPair.shadowNode); calculateShadowViewMutations( *(newGrandChildPairs.size() ? &downwardMutations : &destructiveDownwardMutations), @@ -191,7 +191,7 @@ static void calculateShadowViewMutations( downwardMutations, newChildPair.shadowView, {}, - sliceChildShadowNodeViewPairs(newChildPair.shadowNode)); + sliceChildShadowNodeViewPairs(*newChildPair.shadowNode)); } // All mutations in an optimal order: diff --git a/ReactCommon/fabric/mounting/ShadowView.cpp b/ReactCommon/fabric/mounting/ShadowView.cpp index 53f87e81665..0cd8eee8310 100644 --- a/ReactCommon/fabric/mounting/ShadowView.cpp +++ b/ReactCommon/fabric/mounting/ShadowView.cpp @@ -51,7 +51,7 @@ bool ShadowView::operator!=(const ShadowView &rhs) const { } bool ShadowViewNodePair::operator==(const ShadowViewNodePair &rhs) const { - return &this->shadowNode == &rhs.shadowNode; + return this->shadowNode == rhs.shadowNode; } bool ShadowViewNodePair::operator!=(const ShadowViewNodePair &rhs) const { diff --git a/ReactCommon/fabric/mounting/ShadowView.h b/ReactCommon/fabric/mounting/ShadowView.h index bfa972cda8b..f343c5aac1f 100644 --- a/ReactCommon/fabric/mounting/ShadowView.h +++ b/ReactCommon/fabric/mounting/ShadowView.h @@ -49,8 +49,8 @@ struct ShadowView final { * Describes pair of a `ShadowView` and a `ShadowNode`. */ struct ShadowViewNodePair final { - const ShadowView shadowView; - const ShadowNode &shadowNode; + ShadowView shadowView; + ShadowNode const *shadowNode; /* * The stored pointer to `ShadowNode` represents an indentity of the pair.