.Any(), .Count() -> .Count or .Length
This commit is contained in:
committed by
atlimit8
parent
6eb4fe8980
commit
79f321cb44
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user