Remove YGUnwrapFloatOptional
Summary: Replaces `YGUnwrapFloatOptional` with `YGFloatOptional::unwrap`. This leads to more idiomatic C++, and to less function call nesting, thus increasing readability. Reviewed By: SidharthGuglani Differential Revision: D13439604 fbshipit-source-id: 33b43c08d725c253c359959e7cbbd83fd6bd9ba4
This commit is contained in:
committed by
Facebook Github Bot
parent
6bdd39d0ed
commit
aaa018bbea
@@ -22,6 +22,11 @@ struct YGFloatOptional {
|
||||
// To check if float optional is defined, use `isUndefined()`.
|
||||
float getValue() const;
|
||||
|
||||
// returns the wrapped value, or a value x with YGIsUndefined(x) == true
|
||||
float unwrap() const {
|
||||
return value_;
|
||||
}
|
||||
|
||||
bool isUndefined() const {
|
||||
return std::isnan(value_);
|
||||
}
|
||||
|
Reference in New Issue
Block a user