summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_util.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-08-19 22:23:47 +0200
committerGitHub <noreply@github.com>2017-08-19 22:23:47 +0200
commit88b436e6a9c98af7215bd115e1b7a3f1a1db99d3 (patch)
treef07cdd7f93ca26b84192d7b89f7b952e603ba5cf /src/script/lua_api/l_util.cpp
parent7528986e4449febead9b18b6118f0b096f7cf800 (diff)
downloadminetest-88b436e6a9c98af7215bd115e1b7a3f1a1db99d3.tar.gz
minetest-88b436e6a9c98af7215bd115e1b7a3f1a1db99d3.tar.bz2
minetest-88b436e6a9c98af7215bd115e1b7a3f1a1db99d3.zip
Code modernization: subfolders (#6283)
* Code modernization: subfolders Modernize various code on subfolders client, network, script, threading, unittests, util * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Make connection.cpp readable in a pointed place + typo
Diffstat (limited to 'src/script/lua_api/l_util.cpp')
-rw-r--r--src/script/lua_api/l_util.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp
index c68f64a64..dffbc66d1 100644
--- a/src/script/lua_api/l_util.cpp
+++ b/src/script/lua_api/l_util.cpp
@@ -344,9 +344,9 @@ int ModApiUtil::l_get_dir_list(lua_State *L)
int index = 0;
lua_newtable(L);
- for (size_t i = 0; i < list.size(); i++) {
- if (list_all || list_dirs == list[i].dir) {
- lua_pushstring(L, list[i].name.c_str());
+ for (const fs::DirListNode &dln : list) {
+ if (list_all || list_dirs == dln.dir) {
+ lua_pushstring(L, dln.name.c_str());
lua_rawseti(L, -2, ++index);
}
}
@@ -414,7 +414,7 @@ int ModApiUtil::l_get_version(lua_State *L)
lua_pushstring(L, g_version_string);
lua_setfield(L, table, "string");
- if (strcmp(g_version_string, g_version_hash)) {
+ if (strcmp(g_version_string, g_version_hash) != 0) {
lua_pushstring(L, g_version_hash);
lua_setfield(L, table, "hash");
}