From e64c77fddead6b42a1e7bd624061d0eb5ac0fb9a Mon Sep 17 00:00:00 2001 From: Gustas <37534529+PunkPun@users.noreply.github.com> Date: Sun, 19 Feb 2023 17:23:11 +0200 Subject: [PATCH] Use pattern matching to avoid is check followed by a cast (with variable) --- OpenRA.Game/WPos.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/WPos.cs b/OpenRA.Game/WPos.cs index 15bc17ea06..9acd2decc6 100644 --- a/OpenRA.Game/WPos.cs +++ b/OpenRA.Game/WPos.cs @@ -74,7 +74,7 @@ namespace OpenRA public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode(); } public bool Equals(WPos other) { return other == this; } - public override bool Equals(object obj) { return obj is WPos && Equals((WPos)obj); } + public override bool Equals(object obj) { return obj is WPos pos && Equals(pos); } public override string ToString() { return X + "," + Y + "," + Z; }