From 88b436e6a9c98af7215bd115e1b7a3f1a1db99d3 Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Sat, 19 Aug 2017 22:23:47 +0200 Subject: 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 --- src/script/lua_api/l_util.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/script/lua_api/l_util.cpp') 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"); } -- cgit v1.2.3