From 58da8a1a223601f9c612b41d48d410a461edc0db Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Wed, 13 Oct 2021 15:41:30 +0800 Subject: [PATCH] Use lua_isinteger instead --- lualib-src/lua-bson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lualib-src/lua-bson.c b/lualib-src/lua-bson.c index 2bdd6d9e..8c62c5e8 100644 --- a/lualib-src/lua-bson.c +++ b/lualib-src/lua-bson.c @@ -518,7 +518,7 @@ is_rawarray(lua_State *L) { // empty table return false; } - lua_Integer firstkey = (lua_type(L, -2) == LUA_TNUMBER) ? lua_tointeger(L, -2) : 0; + lua_Integer firstkey = lua_isinteger(L, -2) ? lua_tointeger(L, -2) : 0; lua_pop(L, 2); if (firstkey != 1) return false;