love get* APIs which return tables with fields can optionally accept a table argument to fill in, instead of creating a new table.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-09-22 19:47:55 -03:00
parent a2ad1b462f
commit 4ee85e1793
5 changed files with 48 additions and 16 deletions
+4 -1
View File
@@ -171,7 +171,10 @@ int w_getMode(lua_State *L)
lua_pushnumber(L, w);
lua_pushnumber(L, h);
lua_newtable(L);
if (lua_istable(L, 1))
lua_pushvalue(L, 1);
else
lua_newtable(L);
const char *fstypestr = "desktop";
Window::getConstant(settings.fstype, fstypestr);