diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-12-07 22:34:08 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-12-07 22:34:08 +0300 |
commit | 234306c7ac04691d53a0e0f42c7e699754c8e1d0 (patch) | |
tree | bfb14ed7fd0ee621e50db08b241d7c6b9e33cce6 /ext/intl/msgformat/msgformat_helpers.cpp | |
parent | 3f4a13095e27e3b3610e5f58d256a2b929f26962 (diff) | |
download | php-git-234306c7ac04691d53a0e0f42c7e699754c8e1d0.tar.gz |
Cleanup type conversion
Diffstat (limited to 'ext/intl/msgformat/msgformat_helpers.cpp')
-rw-r--r-- | ext/intl/msgformat/msgformat_helpers.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
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; } |