From 2c62e02b2b09c40745849b8ea4061d7d807ce80d Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 26 Apr 2021 11:57:24 -0700 Subject: [PATCH] Differ: comments Summary: Just adding a comment for future possible refactoring here. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28003338 fbshipit-source-id: ec307314d18d69f8c77c2b2afff1f3953ca55473 --- ReactCommon/react/renderer/mounting/Differentiator.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index 71306025afc..a9c5f5b4825 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -753,6 +753,10 @@ static void calculateShadowViewMutationsFlattener( continue; } + // TODO: compare ShadowNode pointer instead of ShadowView here? + // Or ShadowNode ptr comparison before comparing ShadowView, to allow for + // short-circuiting? ShadowView comparison is relatively expensive vs + // ShadowNode. if (newTreeNodePair.shadowView != oldTreeNodePair.shadowView && newTreeNodePair.isConcreteView && oldTreeNodePair.isConcreteView) { mutationContainer.updateMutations.push_back(