From 710ff5f4c9e0738e9eb90d93200253f2391ccc74 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Sun, 11 Feb 2024 21:02:39 -0800 Subject: [PATCH] Rename sliceChildShadowNodeViewPairsLegacy -> sliceChildShadowNodeViewPairsForTesting (#42928) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42928 Rename sliceChildShadowNodeViewPairsLegacy -> sliceChildShadowNodeViewPairsForTesting changelog: [internal] internal Reviewed By: rshest Differential Revision: D53546236 fbshipit-source-id: a1590880360a7ae072cafeeead29d929f00e551d --- .../react/renderer/mounting/Differentiator.cpp | 9 +++++---- .../ReactCommon/react/renderer/mounting/Differentiator.h | 2 +- .../ReactCommon/react/renderer/mounting/stubs.cpp | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.cpp index cf0aa8dfde3..162ffac0bb1 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -1556,7 +1556,7 @@ static void calculateShadowViewMutationsV2( /** * Only used by unit tests currently. */ -static void sliceChildShadowNodeViewPairsRecursivelyLegacy( +static void sliceChildShadowNodeViewPairsRecursivelyForTesting( ShadowViewNodePair::OwningList& pairList, Point layoutOffset, const ShadowNode& shadowNode) { @@ -1587,7 +1587,7 @@ static void sliceChildShadowNodeViewPairsRecursivelyLegacy( pairList.push_back({shadowView, &childShadowNode}); } - sliceChildShadowNodeViewPairsRecursivelyLegacy( + sliceChildShadowNodeViewPairsRecursivelyForTesting( pairList, origin, childShadowNode); } } @@ -1596,7 +1596,7 @@ static void sliceChildShadowNodeViewPairsRecursivelyLegacy( /** * Only used by unit tests currently. */ -ShadowViewNodePair::OwningList sliceChildShadowNodeViewPairsLegacy( +ShadowViewNodePair::OwningList sliceChildShadowNodeViewPairsForTesting( const ShadowNode& shadowNode) { auto pairList = ShadowViewNodePair::OwningList{}; @@ -1606,7 +1606,8 @@ ShadowViewNodePair::OwningList sliceChildShadowNodeViewPairsLegacy( return pairList; } - sliceChildShadowNodeViewPairsRecursivelyLegacy(pairList, {0, 0}, shadowNode); + sliceChildShadowNodeViewPairsRecursivelyForTesting( + pairList, {0, 0}, shadowNode); return pairList; } diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.h b/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.h index 1aaa5760ca0..6215bad061c 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.h @@ -63,7 +63,7 @@ ShadowViewNodePair::NonOwningList sliceChildShadowNodeViewPairsV2( * Generates a list of `ShadowViewNodePair`s that represents a layer of a * flattened view hierarchy. This is *only* used by unit tests currently. */ -ShadowViewNodePair::OwningList sliceChildShadowNodeViewPairsLegacy( +ShadowViewNodePair::OwningList sliceChildShadowNodeViewPairsForTesting( const ShadowNode& shadowNode); } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/stubs.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/stubs.cpp index 59867f48c0e..fedd71c8d7d 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/stubs.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/stubs.cpp @@ -55,7 +55,7 @@ static void calculateShadowViewMutationsForNewTree( parentShadowView, newChildPair.shadowView, static_cast(index))); auto newGrandChildPairs = - sliceChildShadowNodeViewPairsLegacy(*newChildPair.shadowNode); + sliceChildShadowNodeViewPairsForTesting(*newChildPair.shadowNode); calculateShadowViewMutationsForNewTree( mutations, newChildPair.shadowView, newGrandChildPairs); @@ -70,7 +70,7 @@ StubViewTree buildStubViewTreeWithoutUsingDifferentiator( calculateShadowViewMutationsForNewTree( mutations, ShadowView(rootShadowNode), - sliceChildShadowNodeViewPairsLegacy(rootShadowNode)); + sliceChildShadowNodeViewPairsForTesting(rootShadowNode)); auto emptyRootShadowNode = rootShadowNode.clone(ShadowNodeFragment{ ShadowNodeFragment::propsPlaceholder(),