IDE suggestions

This commit is contained in:
Adrian Conlon
2024-05-19 09:07:20 +01:00
parent 6cbffa1051
commit e0235f396e
19 changed files with 151 additions and 192 deletions

View File

@@ -69,12 +69,26 @@ namespace EightBit
public static bool operator !=(Register16 left, Register16 right) => !(left == right);
public override bool Equals(object obj)
public override int GetHashCode() => this.Word;
public override bool Equals(object? obj)
{
var rhs = obj as Register16;
return rhs == null ? false : rhs.Low == this.Low && rhs.High == this.High;
return Equals(obj as Register16);
}
public override int GetHashCode() => this.Word;
public bool Equals(Register16? rhs)
{
if (ReferenceEquals(this, rhs))
{
return true;
}
if (rhs is null)
{
return false;
}
return rhs.Low == this.Low && rhs.High == this.High;
}
}
}