mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 06:38:13 +00:00
Get rid of static_cast
in YGResolveValue
Summary: @public Removes `static_cast` from `YGResolveValue` Reviewed By: SidharthGuglani Differential Revision: D13439605 fbshipit-source-id: 8736541c8e1d43fd698d368cb4f3211ffd929364
This commit is contained in:
parent
a56b67fa9b
commit
41c326ee9f
@ -95,16 +95,13 @@ inline YGFloatOptional YGResolveValue(
|
||||
const YGValue value,
|
||||
const float ownerSize) {
|
||||
switch (value.unit) {
|
||||
case YGUnitUndefined:
|
||||
case YGUnitAuto:
|
||||
return YGFloatOptional();
|
||||
case YGUnitPoint:
|
||||
return YGFloatOptional(value.value);
|
||||
return YGFloatOptional{value.value};
|
||||
case YGUnitPercent:
|
||||
return YGFloatOptional(
|
||||
static_cast<float>(value.value * ownerSize * 0.01));
|
||||
return YGFloatOptional{value.value * ownerSize * 0.01f};
|
||||
default:
|
||||
return YGFloatOptional{};
|
||||
}
|
||||
return YGFloatOptional();
|
||||
}
|
||||
|
||||
inline bool YGFlexDirectionIsColumn(const YGFlexDirection flexDirection) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user