Skip to content

Commit d179378

Browse files
committed
Removed bc_num_from_xxx wrapper
1 parent 9892fb5 commit d179378

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

ext/bcmath/bcmath.c

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,38 +1128,23 @@ static zend_result bcmath_number_parse_num(zval *zv, zend_object **obj, zend_str
11281128
}
11291129
}
11301130

1131-
static zend_always_inline void bc_num_from_zend_object(const zend_object *obj, bc_num *num, size_t *full_scale)
1132-
{
1133-
bcmath_number_obj_t *intern = get_bcmath_number_from_obj(obj);
1134-
*num = intern->num;
1135-
if (full_scale) {
1136-
*full_scale = intern->scale;
1137-
}
1138-
}
1139-
1140-
static zend_always_inline zend_result bc_num_from_zend_string(const zend_string *str, bc_num *num, size_t *full_scale)
1141-
{
1142-
return php_str2num_ex(num, str, full_scale);
1143-
}
1144-
1145-
static zend_always_inline void bc_num_from_zend_long(zend_long lval, bc_num *num, size_t *full_scale)
1146-
{
1147-
php_long2num(num, lval);
1148-
if (full_scale) {
1149-
*full_scale = 0;
1150-
}
1151-
}
1152-
11531131
static zend_result bc_num_from_obj_or_str_or_long(
11541132
bc_num *num, size_t *full_scale, const zend_object *obj, const zend_string *str, zend_long lval)
11551133
{
11561134
if (obj) {
1157-
bc_num_from_zend_object(obj, num, full_scale);
1135+
bcmath_number_obj_t *intern = get_bcmath_number_from_obj(obj);
1136+
*num = intern->num;
1137+
if (full_scale) {
1138+
*full_scale = intern->scale;
1139+
}
11581140
return SUCCESS;
11591141
} else if (str) {
1160-
return bc_num_from_zend_string(str, num, full_scale);
1142+
return php_str2num_ex(num, str, full_scale);
11611143
} else {
1162-
bc_num_from_zend_long(lval, num, full_scale);
1144+
php_long2num(num, lval);
1145+
if (full_scale) {
1146+
*full_scale = 0;
1147+
}
11631148
return SUCCESS;
11641149
}
11651150
}

0 commit comments

Comments
 (0)