mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
make pop<bool> compare to 0 instead of casting to bool
This commit is contained in:
parent
1c423da153
commit
45f801f740
|
@ -95,7 +95,7 @@ inline T pop(lua_State* L) {
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline bool pop<bool>(lua_State* L) {
|
inline bool pop<bool>(lua_State* L) {
|
||||||
auto result = lua_toboolean(L, -1);
|
bool result = lua_toboolean(L, -1) != 0;
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user