Skip to content
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

Merged
merged 1 commit into from Mar 27, 2021
Merged

Conversation

teinarss
Copy link
Contributor

No description provided.

OpenRA.Mods.Common/Activities/Attack.cs Outdated Show resolved Hide resolved
@@ -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;
Copy link
Member

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?

Copy link
Contributor Author

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise here.

OpenRA.Game/Widgets/Widget.cs Outdated Show resolved Hide resolved
OpenRA.Game/World.cs Outdated Show resolved Hide resolved
OpenRA.Game/Support/ExceptionHandler.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/ActorInitializer.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/Traits/World/EditorCursorLayer.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/Traits/World/Locomotor.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/UtilityCommands/UpdateMapCommand.cs Outdated Show resolved Hide resolved
OpenRA.Platforms.Default/Sdl2PlatformWindow.cs Outdated Show resolved Hide resolved
pchote
pchote previously approved these changes Mar 7, 2021
@pchote
Copy link
Member

pchote commented Mar 27, 2021

Can we get a second review and merge here before we get more rebase issues?

@reaperrr reaperrr merged commit d60c05e into OpenRA:bleed Mar 27, 2021
@teinarss teinarss deleted the pattern_matching branch April 15, 2021 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants