mirror of
https://github.com/status-im/react-native.git
synced 2025-02-24 15:18:10 +00:00
Summary: @public `YGFloatOptional::getValue()` has the unfortunate property of calling `std::exit` if the wrapped value is undefined. That forces `x.isUndefined() ? fallback : x.getValue()` as access pattern. Here, we replace that by introducing `YGFloatOptional::orElse(float)` which encapsulates that pattern. Other additions are `orElseGet([] { … })` and some extra operators. Reviewed By: SidharthGuglani Differential Revision: D13209152 fbshipit-source-id: 4e5deceaaaaf8eaed44846a8c152cc8b235e815c