mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix various points reported by cppcheck (#5656)
* Fix various performance issues reported by cppcheck + code style (CI) * Make CI happy with code style on master * guiFileSelectMenu: remove useless includes * some performance fixes pointed by cppcheck * remove some useless casts * TextDest: remove unused setFormSpec function * Fix various iterator post-increment reported by cppcheck
This commit is contained in:
parent
af96309621
commit
a7e131f53e
13 changed files with 29 additions and 31 deletions
|
@ -534,7 +534,7 @@ int ModApiEnvMod::l_get_objects_inside_radius(lua_State *L)
|
|||
ScriptApiBase *script = getScriptApiBase(L);
|
||||
lua_createtable(L, ids.size(), 0);
|
||||
std::vector<u16>::const_iterator iter = ids.begin();
|
||||
for(u32 i = 0; iter != ids.end(); iter++) {
|
||||
for(u32 i = 0; iter != ids.end(); ++iter) {
|
||||
ServerActiveObject *obj = env->getActiveObject(*iter);
|
||||
// Insert object reference into table
|
||||
script->objectrefGetOrCreate(L, obj);
|
||||
|
@ -985,8 +985,7 @@ int ModApiEnvMod::l_find_path(lua_State *L)
|
|||
lua_newtable(L);
|
||||
int top = lua_gettop(L);
|
||||
unsigned int index = 1;
|
||||
for (std::vector<v3s16>::iterator i = path.begin(); i != path.end();i++)
|
||||
{
|
||||
for (std::vector<v3s16>::iterator i = path.begin(); i != path.end(); ++i) {
|
||||
lua_pushnumber(L,index);
|
||||
push_v3s16(L, *i);
|
||||
lua_settable(L, top);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue