diff --git a/BeefLibs/corlib/src/Nullable.bf b/BeefLibs/corlib/src/Nullable.bf index 324bbfb1..59a6b55d 100644 --- a/BeefLibs/corlib/src/Nullable.bf +++ b/BeefLibs/corlib/src/Nullable.bf @@ -113,7 +113,7 @@ namespace System public static bool operator==(Nullable lhs, Nullable rhs) where bool : operator T == TOther where TOther : struct { - if ((!lhs.mHasValue) || (!rhs.mHasValue)) return false; + if ((!lhs.mHasValue) || (!rhs.mHasValue)) return !lhs.mHasValue && !rhs.mHasValue; // Only both being null results in 'true' return lhs.mValue == rhs.mValue; } @@ -133,7 +133,7 @@ namespace System public static bool operator!=(Nullable lhs, Nullable rhs) where bool : operator T != TOther where TOther : struct { - if ((!lhs.mHasValue) || (!rhs.mHasValue)) return false; + if ((!lhs.mHasValue) || (!rhs.mHasValue)) return !(!lhs.mHasValue && !rhs.mHasValue); // Only both being null results in 'false' return lhs.mValue != rhs.mValue; }