com php-src: Cleanup type conversion: ext/intl/msgformat/msgfor mat_helpers.cpp
| From: | Dmitry Stogov | Date: | Thu, 07 Dec 2017 19:34:08 +0000 |
| Subject: | com php-src: Cleanup type conversion: ext/intl/msgformat/msgfor mat_helpers.cpp | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100524@lists.php.net to get a copy of this message | ||
Commit: 234306c7ac04691d53a0e0f42c7e699754c8e1d0
Author: Dmitry Stogov <dmitry@zend.com> Thu, 7 Dec 2017 22:34:08 +0300
Parents: 3f4a13095e27e3b3610e5f58d256a2b929f26962
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=234306c7ac04691d53a0e0f42c7e699754c8e1d0
Log:
Cleanup type conversion
Changed paths:
M ext/intl/msgformat/msgformat_helpers.cpp
Diff:
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index ce7899e..a8b207f 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;
}