Update Comparison.h

This commit is contained in:
Nick Gerleman
2023-10-03 16:52:33 -07:00
committed by GitHub
parent 55fb80d96b
commit 7a487b3401

View File

@@ -36,16 +36,6 @@ inline float minOrDefined(const float a, const float b) {
return yoga::isUndefined(a) ? b : a; return yoga::isUndefined(a) ? b : a;
} }
inline FloatOptional maxOrDefined(FloatOptional op1, FloatOptional op2) {
if (op1 >= op2) {
return op1;
}
if (op2 > op1) {
return op2;
}
return op1.isUndefined() ? op2 : op1;
}
// Custom equality functions using a hardcoded epsilon of 0.0001f, or returning // Custom equality functions using a hardcoded epsilon of 0.0001f, or returning
// true if both floats are NaN. // true if both floats are NaN.
inline bool inexactEquals(const float a, const float b) { inline bool inexactEquals(const float a, const float b) {
@@ -62,10 +52,6 @@ inline bool inexactEquals(const double a, const double b) {
return yoga::isUndefined(a) && yoga::isUndefined(b); return yoga::isUndefined(a) && yoga::isUndefined(b);
} }
inline bool inexactEquals(const FloatOptional a, const FloatOptional b) {
return inexactEquals(a.unwrap(), b.unwrap());
}
inline bool inexactEquals(const YGValue& a, const YGValue& b) { inline bool inexactEquals(const YGValue& a, const YGValue& b) {
if (a.unit != b.unit) { if (a.unit != b.unit) {
return false; return false;