diff --git a/ReactCommon/fabric/mounting/Differentiator.cpp b/ReactCommon/fabric/mounting/Differentiator.cpp index 84d4931c28a..54b78aafab7 100644 --- a/ReactCommon/fabric/mounting/Differentiator.cpp +++ b/ReactCommon/fabric/mounting/Differentiator.cpp @@ -115,6 +115,29 @@ static ShadowViewNodePair::List sliceChildShadowNodeViewPairs( return pairList; } +/* + * Before we start to diff, let's make sure all our core data structures are in + * good shape to deliver the best performance. + */ +static_assert( + std::is_move_constructible::value, + "`ShadowViewMutation` must be `move constructible`."); +static_assert( + std::is_move_constructible::value, + "`ShadowView` must be `move constructible`."); +static_assert( + std::is_move_constructible::value, + "`ShadowViewNodePair` must be `move constructible`."); +static_assert( + std::is_move_assignable::value, + "`ShadowViewMutation` must be `move assignable`."); +static_assert( + std::is_move_assignable::value, + "`ShadowView` must be `move assignable`."); +static_assert( + std::is_move_assignable::value, + "`ShadowViewNodePair` must be `move assignable`."); + static void calculateShadowViewMutations( ShadowViewMutation::List &mutations, ShadowView const &parentShadowView, @@ -183,7 +206,7 @@ static void calculateShadowViewMutations( auto const &newChildPair = newChildPairs[index]; insertMutations.push_back(ShadowViewMutation::InsertMutation( - parentShadowView, newChildPair.shadowView, index)); + parentShadowView, newChildPair.shadowView, index)); insertedPairs.insert({newChildPair.shadowView.tag, &newChildPair}); }