Eliminate YGFloatOptional::getValue()

Summary:
@public

Replace `YGFloatOptional::getValue()` with `YGFloatOptional::unwrap()`.

`YGFloatOptional::getValue()` has the unfortunate property of calling `std::exit` if the wrapped value is undefined.

Here, we eliminate the method, and just call `.unwrap()` everywhere.

Reviewed By: shergin

Differential Revision: D13439608

fbshipit-source-id: 5ae82b170537d0a10c301412567a7a66fd50bab4
This commit is contained in:
David Aurelio
2018-12-13 07:09:30 -08:00
committed by Facebook Github Bot
parent aaa018bbea
commit 4b5ae211da
9 changed files with 55 additions and 67 deletions

View File

@@ -43,7 +43,7 @@ static void appendFloatOptionalIfDefined(
const string key,
const YGFloatOptional num) {
if (!num.isUndefined()) {
appendFormatedString(base, "%s: %g; ", key.c_str(), num.getValue());
appendFormatedString(base, "%s: %g; ", key.c_str(), num.unwrap());
}
}