Make the return type of YGNodeBoundAxisWithinMinAndMax to YGFloatOptional

Summary: Make the return type of YGNodeBoundAxisWithinMinAndMax to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7323382

fbshipit-source-id: 8e3eb4f3744b5f3f9e2b353f56184905f7557191
This commit is contained in:
Pritesh Nandgaonkar
2018-04-04 07:55:28 -07:00
committed by Facebook Github Bot
parent bb139d3f91
commit a3642541d0
3 changed files with 58 additions and 32 deletions

View File

@@ -68,3 +68,25 @@ YGFloatOptional YGFloatOptional::operator+(const YGFloatOptional& op) {
}
return YGFloatOptional();
}
bool YGFloatOptional::operator>(const YGFloatOptional& op) const {
if (isUndefined_ || op.isUndefined_) {
return false;
}
return value_ > op.value_;
}
bool YGFloatOptional::operator<(const YGFloatOptional& op) const {
if (isUndefined_ || op.isUndefined_) {
return false;
}
return value_ < op.value_;
}
bool YGFloatOptional::operator>=(const YGFloatOptional& op) const {
return *this == op ? true : *this > op;
}
bool YGFloatOptional::operator<=(const YGFloatOptional& op) const {
return *this == op ? true : *this < op;
}