1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Remove unnecessary contains checks

This commit is contained in:
Dean Herbert 2020-09-11 22:03:19 +09:00
parent 22e6df02b6
commit 94d929d8cd

View File

@ -145,16 +145,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <param name="blueprint">The blueprint.</param>
internal void HandleSelected(SelectionBlueprint blueprint)
{
if (!selectedBlueprints.Contains(blueprint))
{
selectedBlueprints.Add(blueprint);
selectedBlueprints.Add(blueprint);
// need to check this as well, as there are potentially multiple SelectionHandlers and the above check is not enough.
if (!EditorBeatmap.SelectedHitObjects.Contains(blueprint.HitObject))
EditorBeatmap.SelectedHitObjects.Add(blueprint.HitObject);
// need to check this as well, as there are potentially multiple SelectionHandlers and the above check is not enough.
if (!EditorBeatmap.SelectedHitObjects.Contains(blueprint.HitObject))
EditorBeatmap.SelectedHitObjects.Add(blueprint.HitObject);
UpdateVisibility();
}
UpdateVisibility();
}
/// <summary>
@ -163,12 +160,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <param name="blueprint">The blueprint.</param>
internal void HandleDeselected(SelectionBlueprint blueprint)
{
if (selectedBlueprints.Remove(blueprint))
{
EditorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject);
EditorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject);
UpdateVisibility();
}
UpdateVisibility();
}
/// <summary>