redundancy reduced

This commit is contained in:
MihailRis
2024-04-30 14:49:55 +03:00
parent 8c86bcae54
commit 9b843817f8
10 changed files with 136 additions and 146 deletions
+2 -2
View File
@@ -90,9 +90,9 @@ static int l_file_mkdirs(lua_State* L) {
static int l_file_read_bytes(lua_State* L) {
fs::path path = resolve_path(L, lua_tostring(L, 1));
if (fs::is_regular_file(path)) {
size_t length = (size_t) fs::file_size(path);
size_t length = static_cast<size_t>(fs::file_size(path));
ubyte* bytes = files::read_bytes(path, length);
auto bytes = files::read_bytes(path, length);
lua_createtable(L, length, 0);
int newTable = lua_gettop(L);
-7
View File
@@ -413,12 +413,6 @@ static int l_gui_get_locales_info(lua_State* L) {
return 1;
}
/// @brief gui.get_locale() -> string
static int l_gui_get_locale(lua_State* L) {
lua_pushstring(L, langs::current->getId().c_str());
return 1;
}
const luaL_Reg guilib [] = {
{"get_viewport", lua_wrap_errors<l_gui_getviewport>},
{"getattr", lua_wrap_errors<l_gui_getattr>},
@@ -426,7 +420,6 @@ const luaL_Reg guilib [] = {
{"get_env", lua_wrap_errors<l_gui_get_env>},
{"str", lua_wrap_errors<l_gui_str>},
{"reindex", lua_wrap_errors<l_gui_reindex>},
{"get_locale", lua_wrap_errors<l_gui_get_locale>},
{"get_locales_info", lua_wrap_errors<l_gui_get_locales_info>},
{NULL, NULL}
};