]> granicus.if.org Git - php/commitdiff
Avoid unnecessary zval separation
authorMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 5 Jun 2003 18:59:55 +0000 (18:59 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Thu, 5 Jun 2003 18:59:55 +0000 (18:59 +0000)
ext/domxml/php_domxml.c

index 681d4b2fcbb121e5a8acde107aa869f8478d9ff4..dd5bc562d2604bb5fcf686cc54ff0034ce6747f5 100644 (file)
@@ -1090,8 +1090,10 @@ static char **php_xmlparser_make_params(zval *idvars TSRMLS_DC)
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument or parameter array");
                        return NULL;
                } else {
-                       SEPARATE_ZVAL(value);
-                       convert_to_string_ex(value);
+                       if (Z_TYPE_PP(value) != IS_STRING) {
+                               SEPARATE_ZVAL(value);
+                               convert_to_string(*value);
+                       }
                        expr = Z_STRVAL_PP(value);
        
                        if (expr) {
@@ -5481,8 +5483,10 @@ static char **php_domxslt_make_params(zval *idvars, int xpath_params TSRMLS_DC)
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument or parameter array");
                        return NULL;
                } else {
-                       SEPARATE_ZVAL(value);
-                       convert_to_string_ex(value);
+                       if (Z_TYPE_PP(value) != IS_STRING) {
+                               SEPARATE_ZVAL(value);
+                               convert_to_string(*value);
+                       }
 
                        if (!xpath_params) {
                                xpath_expr = php_domxslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC);