Skip to content

Commit 4e92c96

Browse files
committed
Removed null check from bcmath_number_compare
1 parent d179378 commit 4e92c96

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ext/bcmath/bcmath.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,15 +1257,11 @@ static int bcmath_number_compare(zval *op1, zval *op2)
12571257
bc_num n1 = NULL;
12581258
bc_num n2 = NULL;
12591259

1260-
if (UNEXPECTED(Z_TYPE_P(op1) == IS_NULL)) {
1261-
lval1 = 0;
1262-
} else if (UNEXPECTED(bcmath_number_parse_num(op1, &obj1, &str1, &lval1) == FAILURE)) {
1260+
if (UNEXPECTED(bcmath_number_parse_num(op1, &obj1, &str1, &lval1) == FAILURE)) {
12631261
goto fallback;
12641262
}
12651263

1266-
if (UNEXPECTED(Z_TYPE_P(op2) == IS_NULL)) {
1267-
lval2 = 0;
1268-
} else if (UNEXPECTED(bcmath_number_parse_num(op2, &obj2, &str2, &lval2) == FAILURE)) {
1264+
if (UNEXPECTED(bcmath_number_parse_num(op2, &obj2, &str2, &lval2) == FAILURE)) {
12691265
goto fallback;
12701266
}
12711267

0 commit comments

Comments
 (0)