From: Dmitry Stogov Date: Thu, 7 Dec 2017 19:34:08 +0000 (+0300) Subject: Cleanup type conversion X-Git-Tag: php-7.3.0alpha1~856 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=234306c7ac04691d53a0e0f42c7e699754c8e1d0;p=php Cleanup type conversion --- diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index ce7899edd9..a8b207ff73 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -467,18 +467,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, } case Formattable::kDouble: { - double d; - if (Z_TYPE_P(elem) == IS_DOUBLE) { - d = Z_DVAL_P(elem); - } else if (Z_TYPE_P(elem) == IS_LONG) { - d = (double)Z_LVAL_P(elem); - } else { - SEPARATE_ZVAL_IF_NOT_REF(elem); - convert_scalar_to_number(elem); - d = (Z_TYPE_P(elem) == IS_DOUBLE) - ? Z_DVAL_P(elem) - : (double)Z_LVAL_P(elem); - } + double d = zval_get_double(elem); formattable.setDouble(d); break; }