Replace uses of .size() or .length() with .empty() when appropriate (#25950)

This commit is contained in:
matheusvb3 authored and GitHub committed 2026-02-05 13:14:12 +01:00
1 parent d237721e68
commit 416a005b88
28 files changed
+60 -60

No files matched your search

@@ -1273,7 +1273,7 @@ static void ConsoleCommandForceDate([[maybe_unused]] InteractiveConsole& console
int32_t year = 0;
int32_t month = 0;
int32_t day = 0;
if (argv.size() < 1 || argv.size() > 3)
if (argv.empty() || argv.size() > 3)
{
return;
}
@@ -1327,7 +1327,7 @@ static void ConsoleCommandForceDate([[maybe_unused]] InteractiveConsole& console
static void ConsoleCommandLoadPark([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
{
if (argv.size() < 1)
if (argv.empty())
{
console.WriteLine("Parameters required <filename>");
return;
@@ -1362,7 +1362,7 @@ static void ConsoleCommandLoadPark([[maybe_unused]] InteractiveConsole& console,
static void ConsoleCommandSavePark([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
{
if (argv.size() < 1)
if (argv.empty())
{
SaveGameCmd();
}
@@ -1398,7 +1398,7 @@ static void ConsoleCommandReplayStartRecord(InteractiveConsole& console, const a
return;
}
if (argv.size() < 1)
if (argv.empty())
{
console.WriteFormatLine("Parameters required <replay_name> [<max_ticks = 0xFFFFFFFF>]");
return;
@@ -1471,7 +1471,7 @@ static void ConsoleCommandReplayStart(InteractiveConsole& console, const argumen
return;
}
if (argv.size() < 1)
if (argv.empty())
{
console.WriteFormatLine("Parameters required <replay_name>");
return;
@@ -1556,7 +1556,7 @@ static void ConsoleCommandReplayNormalise(InteractiveConsole& console, const arg
static void ConsoleCommandMpDesync(InteractiveConsole& console, const arguments_t& argv)
{
int32_t desyncType = 0;
if (argv.size() >= 1)
if (!argv.empty())
{
desyncType = atoi(argv[0].c_str());
}
@@ -1698,7 +1698,7 @@ static void ConsoleCommandProfilerStart([[maybe_unused]] InteractiveConsole& con
static void ConsoleCommandProfilerExportCSV(
[[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
{
if (argv.size() < 1)
if (argv.empty())
{
console.WriteLineError("Missing argument: <file path>");
}
@@ -1719,7 +1719,7 @@ static void ConsoleCommandProfilerStop([[maybe_unused]] InteractiveConsole& cons
Profiling::Disable();
// Export to CSV if argument is provided.
if (argv.size() >= 1)
if (!argv.empty())
{
return ConsoleCommandProfilerExportCSV(console, argv);
}