mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Fixed != and ==
This commit is contained in:
parent
1ca01864bb
commit
b21cd0f197
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue