mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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
This commit is contained in:
parent
7528986e44
commit
88b436e6a9
49 changed files with 398 additions and 518 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue