From d44830c945b99fb323cb1fac62f69091882100c0 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Tue, 24 Mar 2015 22:38:31 +0000 Subject: [PATCH] Inline the equality test in CPos.Equals for performance. --- OpenRA.Game/CPos.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/CPos.cs b/OpenRA.Game/CPos.cs index eaee345a62..2940bb8b67 100644 --- a/OpenRA.Game/CPos.cs +++ b/OpenRA.Game/CPos.cs @@ -37,7 +37,7 @@ namespace OpenRA public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); } - public bool Equals(CPos other) { return other == this; } + public bool Equals(CPos other) { return X == other.X && Y == other.Y; } public override bool Equals(object obj) { return obj is CPos && Equals((CPos)obj); } public override string ToString() { return X + "," + Y; }