summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_util.cpp
diff options
context:
space:
mode:
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");
}