refactor: optimize string operations and improve code clarity

- Avoid redundant substr() calls in packet parsing hot-path (TServer.cpp)
  The previous code called substr(3) twice per packet, creating
  unnecessary temporary strings. Now stores the result once.

- Replace .size() == 0 with .empty() for idiomatic C++
  (TConsole.cpp, TLuaEngine.cpp)
This commit is contained in:
Kipstz committed 2025-12-27 23:46:45 +01:00
1 parent 420c64f6cf
commit b74f0c7ca8
3 files changed
+9 -7

No files matched your search

+1 -1
View File
@@ -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 {