From c6e203bdb0c253fa803bb09ce2464238ab91f60d Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Sun, 12 Sep 2021 08:55:21 -0700 Subject: [PATCH] Prevent implicit conversion to boolean Summary: changelog: [internal] This looks like a bug where the author did not intend the conversion to boolean. This means that `onlyMutationIsUpdate` was evaluated to true even if more than 1 animation was in the vector. Reviewed By: RSNara Differential Revision: D30767172 fbshipit-source-id: 0ef47b65a5d8ef07d774d9e0b358e5642dc0a9ea --- .../renderer/animations/LayoutAnimationKeyFrameManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp index 31e08ff8dcc..846085ed04d 100644 --- a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +++ b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp @@ -785,7 +785,7 @@ LayoutAnimationKeyFrameManager::pullTransaction( // don't want to queue up any final UPDATE mutations here. bool shouldGenerateSyntheticMutations = keyFrame.generateFinalSyntheticMutations; - bool numFinalMutations = keyFrame.finalMutationsForKeyFrame.size(); + auto numFinalMutations = keyFrame.finalMutationsForKeyFrame.size(); bool onlyMutationIsUpdate = (numFinalMutations == 1 && keyFrame.finalMutationsForKeyFrame[0].type ==