.Any(), .Count() -> .Count or .Length

This commit is contained in:
Eduardo Cáceres
2022-05-02 13:05:22 +02:00
committed by atlimit8
parent 6eb4fe8980
commit 79f321cb44
138 changed files with 233 additions and 258 deletions

View File

@@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
Delete(selectedSave);
if (!games.Any() && !isSavePanel)
if (games.Count == 0 && !isSavePanel)
{
Ui.CloseWindow();
onExit();
@@ -150,7 +150,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
};
var deleteAllButton = panel.Get<ButtonWidget>("DELETE_ALL_BUTTON");
deleteAllButton.IsDisabled = () => !games.Any();
deleteAllButton.IsDisabled = () => games.Count == 0;
deleteAllButton.OnClick = () =>
{
ConfirmationDialogs.ButtonPrompt(
@@ -355,7 +355,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (!Directory.Exists(baseSavePath))
return false;
return Directory.GetFiles(baseSavePath, "*.orasav", SearchOption.AllDirectories).Any();
return Directory.GetFiles(baseSavePath, "*.orasav", SearchOption.AllDirectories).Length > 0;
}
}
}