From 51e6095005fd713dbfcbaf2c6296009de782d966 Mon Sep 17 00:00:00 2001 From: Yurii Nakonechnyi Date: Mon, 24 Mar 2025 12:23:46 -0700 Subject: [PATCH] LayoutData - added explicit default fields values initialization (#1802) Summary: X-link: https://github.com/facebook/react-native/pull/50227 Explicit defaults add 'strictness' and take the guesswork out of what's going on in places like this: https://github.com/facebook/yoga/blob/6455a848a76f433bdb48b2640b7f4644774c76fd/yoga/algorithm/CalculateLayout.cpp#L2345 Changelog: [Internal] Pull Request resolved: https://github.com/facebook/yoga/pull/1802 Reviewed By: javache Differential Revision: D71687310 Pulled By: NickGerleman fbshipit-source-id: f11d18aa68ce7ccd17fb1d5af0e729e8c0711cf9 --- yoga/event/event.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yoga/event/event.h b/yoga/event/event.h index b4be8ab2..587c1cd0 100644 --- a/yoga/event/event.h +++ b/yoga/event/event.h @@ -36,12 +36,12 @@ enum struct LayoutPassReason : int { }; struct LayoutData { - int layouts; - int measures; - uint32_t maxMeasureCache; - int cachedLayouts; - int cachedMeasures; - int measureCallbacks; + int layouts = 0; + int measures = 0; + uint32_t maxMeasureCache = 0; + int cachedLayouts = 0; + int cachedMeasures = 0; + int measureCallbacks = 0; std::array(LayoutPassReason::COUNT)> measureCallbackReasonsCount; };