Make equality operator for YGValue
inlineable
Summary: @public Makes `operator==` for `YGValue` an inline function. Reviewed By: SidharthGuglani Differential Revision: D13189356 fbshipit-source-id: 7fe61035acf635e22ebb1a1071925d6b3dad0616
This commit is contained in:
committed by
Facebook Github Bot
parent
d19da9e528
commit
ed5c5a799f
@@ -9,21 +9,3 @@
|
||||
const YGValue YGValueZero = {0, YGUnitPoint};
|
||||
const YGValue YGValueUndefined = {YGUndefined, YGUnitUndefined};
|
||||
const YGValue YGValueAuto = {YGUndefined, YGUnitAuto};
|
||||
|
||||
bool operator==(const YGValue& lhs, const YGValue& rhs) {
|
||||
if (lhs.unit != rhs.unit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (lhs.unit) {
|
||||
case YGUnitUndefined:
|
||||
case YGUnitAuto:
|
||||
return true;
|
||||
default:
|
||||
return lhs.value == rhs.value;
|
||||
}
|
||||
}
|
||||
|
||||
bool operator!=(const YGValue& lhs, const YGValue& rhs) {
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
Reference in New Issue
Block a user