Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit f5bc7d2

Browse files
committed
Improved the Position.Equals
1 parent 94f0ae8 commit f5bc7d2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Visual Studio Project Template C#/PluginInfrastructure/GatewayDomain.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,13 @@ public int Value
8888

8989
public static bool operator ==(Position a, Position b)
9090
{
91-
return ReferenceEquals(a, b) || a.pos == b.pos;
91+
if (ReferenceEquals(a, b))
92+
return true;
93+
if (ReferenceEquals(a, null))
94+
return false;
95+
if (ReferenceEquals(b, null))
96+
return false;
97+
return a.pos == b.pos;
9298
}
9399

94100
public static bool operator !=(Position a, Position b)

0 commit comments

Comments
 (0)