Skip to content

Use HashSets instead of .Distinct#21311

Merged
atlimit8 merged 1 commit into
OpenRA:bleedfrom
PunkPun:hashset
Jan 31, 2024
Merged

Use HashSets instead of .Distinct#21311
atlimit8 merged 1 commit into
OpenRA:bleedfrom
PunkPun:hashset

Conversation

@PunkPun

@PunkPun PunkPun commented Jan 22, 2024

Copy link
Copy Markdown
Member

Using the correct data type should require less cycles. Also removed a few unnecessary casts to array / list

@RoosterDragon RoosterDragon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As Distinct() preserves the original ordering, in a few cases I think it'd be safer to stick with that just in case rather than switching to a set which won't preserve the order.

Comment thread OpenRA.Mods.Cnc/UtilityCommands/LegacyTilesetImporter.cs Outdated
Comment thread OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs Outdated
Comment thread OpenRA.Mods.Common/Scripting/Properties/ProductionProperties.cs Outdated
Comment thread OpenRA.Mods.Common/Widgets/Logic/Installation/ModContentLogic.cs Outdated
And don't cast to array / list where unnecessary
@atlimit8 atlimit8 merged commit 6026d08 into OpenRA:bleed Jan 31, 2024
@atlimit8

Copy link
Copy Markdown
Member

Changelog

@PunkPun PunkPun deleted the hashset branch January 31, 2024 08:13
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.

3 participants