fix: optimization: PVS-Studio warning V831

Replaced 'at()' method with 'operator[]' to improve performance.

The 'at()' method performs bounds checking, which can introduce overhead. Using 'operator[]' bypasses this check and can improve performance when you are certain that the index is within bounds.

Reported by: PVS-Studio
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
Vyacheslav Ivanov
2024-08-03 17:46:29 +03:00
committed by MihailRis
parent 97a0bb5776
commit 8c5e5559ec
6 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ static int l_get_command_info(lua::State* L) {
lua::createtable(L, args.size(), 0);
for (size_t i = 0; i < args.size(); i++) {
auto& arg = args.at(i);
auto& arg = args[i];
lua::createtable(L, 0, 2);
lua::pushstring(L, arg.name);