Always reuse functions, avoid duplicate code...

This commit is contained in:
ThePhD 2015-07-20 20:28:10 -04:00
parent 219d10b0b4
commit 946d01d228

View File

@ -263,9 +263,7 @@ struct getter<T*> {
type t = type_of(L, index); type t = type_of(L, index);
if (t == type::nil) if (t == type::nil)
return nullptr; return nullptr;
void* udata = lua_touserdata(L, index); return getter<T&>{}.get(L, index);
T** obj = static_cast<T**>(udata);
return *obj;
} }
}; };