Remove redundant check for narr and nrec variables in create_table

This commit is contained in:
Rapptz 2013-12-12 05:12:45 -05:00
parent fdf145ecd8
commit c241a3df92

View File

@ -152,13 +152,7 @@ public:
template<typename T>
table create_table(T&& key, int narr = 0, int nrec = 0) {
if(narr == 0 && nrec == 0) {
lua_newtable(L.get());
}
else {
lua_createtable(L.get(), narr, nrec);
}
lua_createtable(L.get(), narr, nrec);
table result(L.get());
lua_pop(L.get(), 1);
global.set(std::forward<T>(key), result);
@ -166,13 +160,7 @@ public:
}
table create_table(int narr = 0, int nrec = 0) {
if(narr == 0 && nrec == 0) {
lua_newtable(L.get());
}
else {
lua_createtable(L.get(), narr, nrec);
}
lua_createtable(L.get(), narr, nrec);
table result(L.get());
lua_pop(L.get(), 1);
return result;