Use pattern matching

This commit is contained in:
Eduardo Cáceres
2022-05-02 13:11:49 +02:00
committed by atlimit8
parent aed2b8afae
commit 2677e9c013
15 changed files with 83 additions and 90 deletions

View File

@@ -98,7 +98,7 @@ namespace OpenRA.Primitives
public static bool operator !=(BitSet<T> me, BitSet<T> other) { return !(me == other); }
public bool Equals(BitSet<T> other) { return other == this; }
public override bool Equals(object obj) { return obj is BitSet<T> && Equals((BitSet<T>)obj); }
public override bool Equals(object obj) { return obj is BitSet<T> bitSet && Equals(bitSet); }
public override int GetHashCode() { return bits.GetHashCode(); }
public bool IsEmpty => bits == 0;