From 42dcfdd2cdb59fe545523cb57db6ee32a96b9298 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Thu, 22 Aug 2024 00:14:38 -0700 Subject: [PATCH] avoid default when switching on UnitType (#46146) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46146 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. Reviewed By: NickGerleman Differential Revision: D61635463 fbshipit-source-id: b84b5518f2a17e792309f85ae91514a17abad295 --- .../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; } }