From b21cd0f197f6235dd3a0d65dab5ca186a7dad59c Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 3 Apr 2020 10:34:41 -0700 Subject: [PATCH] Fixed != and == --- BeefLibs/corlib/src/Nullable.bf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }