mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 08:26:50 +00:00
Proper null checks in C# operator ==
This commit is contained in:
@@ -80,8 +80,8 @@ namespace renderdocui.Code
|
||||
}
|
||||
public static bool operator ==(FormatElement x, FormatElement y)
|
||||
{
|
||||
if ((object)x == null) return false;
|
||||
if ((object)y == null) return false;
|
||||
if ((object)x == null) return (object)y == null;
|
||||
if ((object)y == null) return (object)x == null;
|
||||
|
||||
return x.name == y.name &&
|
||||
x.buffer == y.buffer &&
|
||||
|
||||
@@ -146,6 +146,9 @@ namespace renderdoc
|
||||
}
|
||||
public static bool operator ==(ResourceFormat x, ResourceFormat y)
|
||||
{
|
||||
if ((object)x == null) return (object)y == null;
|
||||
if ((object)y == null) return (object)x == null;
|
||||
|
||||
if (x.special || y.special)
|
||||
return x.special == y.special && x.specialFormat == y.specialFormat;
|
||||
|
||||
|
||||
@@ -482,6 +482,9 @@ namespace renderdoc
|
||||
}
|
||||
public static bool operator ==(BindpointMap x, BindpointMap y)
|
||||
{
|
||||
if ((object)x == null) return (object)y == null;
|
||||
if ((object)y == null) return (object)x == null;
|
||||
|
||||
return x.bindset == y.bindset &&
|
||||
x.bind == y.bind;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user