Use pattern matching to avoid is check followed by a cast (with variable)

This commit is contained in:
Gustas
2023-02-19 17:23:11 +02:00
committed by Pavel Penev
parent 8d0fe52dd8
commit e64c77fdde

View File

@@ -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; }