diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-04-25 10:17:53 +0200 |
---|---|---|
committer | Loïc Blot <loic.blot@unix-experience.fr> | 2017-04-25 10:21:42 +0200 |
commit | a7e131f53e211ffbe38d34d23b33e13cc401f013 (patch) | |
tree | c615160a94df851752d62bfc2a4cf9f4d01f63ab /src/script/lua_api/l_env.cpp | |
parent | af9630962134346750f12c9f1856eae00e0dfe02 (diff) | |
download | minetest-a7e131f53e211ffbe38d34d23b33e13cc401f013.tar.gz minetest-a7e131f53e211ffbe38d34d23b33e13cc401f013.tar.bz2 minetest-a7e131f53e211ffbe38d34d23b33e13cc401f013.zip |
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
Diffstat (limited to 'src/script/lua_api/l_env.cpp')
-rw-r--r-- | src/script/lua_api/l_env.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 1fa7845b5..75b07fa37 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -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); |