Get rid of `static_cast` in `YGResolveValue`

Summary:
@public

Removes `static_cast` from `YGResolveValue`

Reviewed By: SidharthGuglani

Differential Revision: D13209155

fbshipit-source-id: 76c27c89f6217af9dfef9e2620d639c9f3e212f5
This commit is contained in:
David Aurelio 2018-12-06 07:35:10 -08:00 committed by Facebook Github Bot
parent ceb6602422
commit fa171b4fe7
1 changed files with 4 additions and 7 deletions

View File

@ -100,16 +100,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) {