From a1bcdb091df348f8c0ccad760ef67215def1d7a0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 20 Jan 2025 15:55:13 +0900 Subject: [PATCH] Adjust code slightly --- .../Screens/Editors/TeamEditorScreen.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs index 4008f9d140..162379f4aa 100644 --- a/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs @@ -185,19 +185,18 @@ namespace osu.Game.Tournament.Screens.Editors Model.Acronym.BindValueChanged(acronym => { - var matchingTeams = ladderInfo.Teams - .Where(t => t.Acronym.Value == acronym.NewValue && t != Model) - .ToList(); + var teamsWithSameAcronym = ladderInfo.Teams + .Where(t => t.Acronym.Value == acronym.NewValue && t != Model) + .ToList(); - if (matchingTeams.Count > 0) + if (teamsWithSameAcronym.Count > 0) { acronymTextBox.SetNoticeText( - $"Acronym '{acronym.NewValue}' is already in use by team{(matchingTeams.Count > 1 ? "s" : "")}:\n" - + $"{string.Join(",\n", matchingTeams)}", true); - return; + $"Acronym '{acronym.NewValue}' is already in use by team{(teamsWithSameAcronym.Count > 1 ? "s" : "")}:\n" + + $"{string.Join(",\n", teamsWithSameAcronym)}", true); } - - acronymTextBox.ClearNoticeText(); + else + acronymTextBox.ClearNoticeText(); }, true); }