New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change to use pattern matching #19200
Conversation
@@ -81,8 +81,7 @@ public bool Equals(Hotkey other) | |||
|
|||
public override bool Equals(object obj) | |||
{ | |||
var o = obj as Hotkey?; | |||
return o != null && o == this; | |||
return obj is Hotkey o && (Hotkey?)o == this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does Hotkey
vs Hotkey?
matter here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never seen it done like this, usually its done like return obj is Hotkey o && Equals(o);
@@ -55,8 +55,7 @@ public bool Equals(float3 other) | |||
|
|||
public override bool Equals(object obj) | |||
{ | |||
var o = obj as float3?; | |||
return o != null && o == this; | |||
return obj is float3 o && (float3?)o == this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise here.
63d1dcf
to
dd23c84
Compare
dd23c84
to
0e93770
Compare
Can we get a second review and merge here before we get more rebase issues? |
No description provided.