com php-src: Drop unnecessary zval containers: ext/soap/php_e ncoding.c ext/standard/string.c

From: Date: Sat, 06 Dec 2014 11:38:56 +0000
Subject: com php-src: Drop unnecessary zval containers: ext/soap/php_e ncoding.c ext/standard/string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-83554@lists.php.net to get a copy of this message
Commit: 204e3f8d5a180086671fec49afb3c7abf90721d4 Author: Nikita Popov <nikic@php.net> Wed, 22 Oct 2014 20:13:22 +0200 Parents: 51bae8805d267e45bb29b126b9f4c450d79de1b5 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=204e3f8d5a180086671fec49afb3c7abf90721d4 Log: Drop unnecessary zval containers Changed paths: M ext/soap/php_encoding.c M ext/standard/string.c Diff: diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 9719165..9e554a9 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -3134,11 +3134,9 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP if (Z_TYPE_P(data) == IS_STRING) { ret = xmlNewTextLen(BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data)); } else { - zval tmp; - - ZVAL_STR(&tmp, zval_get_string(data)); - ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp)); - zval_dtor(&tmp); + zend_string *tmp = zval_get_string(data); + ret = xmlNewTextLen(BAD_CAST(tmp->val), tmp->len); + zend_string_release(tmp); } ret->name = xmlStringTextNoenc; diff --git a/ext/standard/string.c b/ext/standard/string.c index 5d5f432..ec86b08 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1672,18 +1672,11 @@ static int php_needle_char(zval *needle, char *target TSRMLS_DC) *target = (char)(int)Z_DVAL_P(needle); return SUCCESS; case IS_OBJECT: - { - zval holder; - - ZVAL_LONG(&holder, zval_get_long(needle)); - - *target = (char)Z_LVAL(holder); - return SUCCESS; - } - default: { + *target = (char) zval_get_long(needle); + return SUCCESS; + default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "needle is not a string or an integer"); return FAILURE; - } } } /* }}} */

« previous php.cvs (#83554) next »