Skip to content

Commit 23d6f07

Browse files
committed
Replace short functions with long functions
checkint -> checkinteger optint -> optinteger Older lua versions had redundant functions, but one with a shorter name than the other. Newer Lua versions only retain the long version. one is an alias of the other, but one was removed in 5.3+, so it's better to use the common function across all versions.
1 parent 42f7a28 commit 23d6f07

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua_cmsgpack.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,15 +836,15 @@ static int mp_unpack(lua_State *L) {
836836
}
837837

838838
static int mp_unpack_one(lua_State *L) {
839-
int offset = luaL_optint(L, 2, 0);
839+
int offset = luaL_optinteger(L, 2, 0);
840840
/* Variable pop because offset may not exist */
841841
lua_pop(L, lua_gettop(L)-1);
842842
return mp_unpack_full(L, 1, offset);
843843
}
844844

845845
static int mp_unpack_limit(lua_State *L) {
846-
int limit = luaL_checkint(L, 2);
847-
int offset = luaL_optint(L, 3, 0);
846+
int limit = luaL_checkinteger(L, 2);
847+
int offset = luaL_optinteger(L, 3, 0);
848848
/* Variable pop because offset may not exist */
849849
lua_pop(L, lua_gettop(L)-1);
850850

0 commit comments

Comments
 (0)