Skip to content

Commit eaffa11

Browse files
committed
ext/gmp: Compare object CE to gmp_ce directly
The GMP class is now final, therefore we don't need to use the instanceof function.
1 parent 313886e commit eaffa11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/gmp/gmp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ PHP_GMP_API zend_class_entry *php_gmp_class_entry(void) {
9696
((__GNU_MP_VERSION >= 6) || (__GNU_MP_VERSION >= 5 && __GNU_MP_VERSION_MINOR >= 1))
9797

9898
#define IS_GMP(zval) \
99-
(Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), gmp_ce))
99+
(Z_TYPE_P(zval) == IS_OBJECT && Z_OBJCE_P(zval) == gmp_ce)
100100

101101
#define GET_GMP_OBJECT_FROM_OBJ(obj) \
102102
php_gmp_object_from_zend_object(obj)
@@ -116,7 +116,7 @@ static bool gmp_zend_parse_arg_into_mpz_ex(
116116
bool is_operator
117117
) {
118118
if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) {
119-
if (EXPECTED(instanceof_function(Z_OBJCE_P(arg), gmp_ce))) {
119+
if (EXPECTED(Z_OBJCE_P(arg) == gmp_ce)) {
120120
*destination_mpz_ptr = GET_GMP_FROM_ZVAL(arg);
121121
return true;
122122
}

0 commit comments

Comments
 (0)