diff --git a/src/TConsole.cpp b/src/TConsole.cpp index 33ff8f0..fb1dc8b 100644 --- a/src/TConsole.cpp +++ b/src/TConsole.cpp @@ -160,7 +160,7 @@ void TConsole::ChangeToRegularConsole() { } bool TConsole::EnsureArgsCount(const std::vector& args, size_t n) { - if (n == 0 && args.size() != 0) { + if (n == 0 && !args.empty()) { Application::Console().WriteRaw("This command expects no arguments."); return false; } else if (args.size() != n) { @@ -198,7 +198,7 @@ void TConsole::Command_Lua(const std::string&, const std::vector& a } else { Application::Console().WriteRaw("Lua state '" + NewStateId + "' is not a known state. Didn't switch to Lua."); } - } else if (args.size() == 0) { + } else if (args.empty()) { ChangeToLuaConsole(mDefaultStateId); } } @@ -423,7 +423,7 @@ void TConsole::Command_Settings(const std::string&, const std::vector sets specified setting to value )"; - if (args.size() == 0) { + if (args.empty()) { beammp_errorf("No arguments specified for command 'settings'!"); Application::Console().WriteRaw("BeamMP-Server Console: " + std::string(sHelpString)); return; @@ -705,7 +705,7 @@ void TConsole::RunAsCommand(const std::string& cmd, bool IgnoreNotACommand) { } } } - if (NonNilFutures.size() == 0) { + if (NonNilFutures.empty()) { if (!IgnoreNotACommand) { Application::Console().WriteRaw("Error: Unknown command: '" + cmd + "'. Type 'help' to see a list of valid commands."); } diff --git a/src/TLuaEngine.cpp b/src/TLuaEngine.cpp index 83fa34f..a15a535 100644 --- a/src/TLuaEngine.cpp +++ b/src/TLuaEngine.cpp @@ -131,7 +131,7 @@ void TLuaEngine::operator()() { } } } - if (mLuaStates.size() == 0) { + if (mLuaStates.empty()) { beammp_trace("No Lua states, event loop running extremely sparsely"); Application::SleepSafeSeconds(10); } else { diff --git a/src/TServer.cpp b/src/TServer.cpp index b064e87..2618840 100644 --- a/src/TServer.cpp +++ b/src/TServer.cpp @@ -198,7 +198,8 @@ void TServer::GlobalParser(const std::weak_ptr& Client, std::vector& Client, std::vector