Implement is_truthy using l_isfalse
@@ -76,6 +76,12 @@ int pallene_l_strcmp(
/* Inline functions and macros */
/* --------------------------- */
+static inline
+int pallene_is_truthy(const TValue *v)
+{
+ return !l_isfalse(v);
+}
+
/* This is a workaround to avoid -Wmaybe-uninitialized warnings with GCC. If we
* initialize a TValue with setnilvalue and then follow that with a setobj, GCC
* complains that the setobj might be reading from an uninitialized obj->value_.
@@ -221,12 +227,6 @@ void pallene_renormalize_array(
}
}
-static inline
-int pallene_is_truthy(const TValue *v)
-{
- return !(ttisnil(v) || (ttisboolean(v) && bvalue(v) == 0));
-}
-
static const TValue PALLENE_ABSENTKEY = {ABSTKEYCONSTANT};
/* This function is a speciallization of luaH_getshortstr from ltable.c */
