summaryrefslogtreecommitdiff
path: root/libs/liblua/src/lvm.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/liblua/src/lvm.h')
-rw-r--r--libs/liblua/src/lvm.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/liblua/src/lvm.h b/libs/liblua/src/lvm.h
index 2d4ac160fe..1bc16f3a50 100644
--- a/libs/liblua/src/lvm.h
+++ b/libs/liblua/src/lvm.h
@@ -60,12 +60,14 @@ typedef enum {
/* convert an object to an integer (including string coercion) */
#define tointeger(o,i) \
- (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointeger(o,i,LUA_FLOORN2I))
+ (l_likely(ttisinteger(o)) ? (*(i) = ivalue(o), 1) \
+ : luaV_tointeger(o,i,LUA_FLOORN2I))
/* convert an object to an integer (without string coercion) */
#define tointegerns(o,i) \
- (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointegerns(o,i,LUA_FLOORN2I))
+ (l_likely(ttisinteger(o)) ? (*(i) = ivalue(o), 1) \
+ : luaV_tointegerns(o,i,LUA_FLOORN2I))
#define intop(op,v1,v2) l_castU2S(l_castS2U(v1) op l_castS2U(v2))