From a33e025d5141a99f64121091d99bb5616d236f04 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 21 Aug 2024 16:44:56 -0700 Subject: [PATCH] avoid default when switching on UnitType Summary: Changelog: [Internal] `unit` is of type `UnitType`, so there's no reason to have a default case here. i found this because my build failed when pulling in this dependency, there was a compiler flag that enforced that all cases must be enumerated. this seems like the right practice anyways. Differential Revision: D61635463 --- .../ReactCommon/react/renderer/graphics/ValueUnit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h b/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h index ae2363745def95..c9d3b6141d862c 100644 --- a/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h +++ b/packages/react-native/ReactCommon/react/renderer/graphics/ValueUnit.h @@ -35,7 +35,7 @@ struct ValueUnit { return value; case UnitType::Percent: return value * referenceLength * 0.01f; - default: + case UnitType::Undefined: return 0.0f; } }