1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Fixed != and ==

This commit is contained in:
Brian Fiete 2020-04-03 10:34:41 -07:00
parent 1ca01864bb
commit b21cd0f197

View file

@ -113,7 +113,7 @@ namespace System
public static bool operator==<TOther>(Nullable<T> lhs, Nullable<TOther> 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!=<TOther>(Nullable<T> lhs, Nullable<TOther> 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;
}