mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Always reuse functions, avoid duplicate code...
This commit is contained in:
parent
219d10b0b4
commit
946d01d228
|
@ -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;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user