com php-src: Avoding superfluous function call: ext/standard/var.c
| From: | Xinchen Hui | Date: | Mon, 01 Oct 2012 16:28:38 +0000 |
| Subject: | com php-src: Avoding superfluous function call: ext/standard/var.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70294@lists.php.net to get a copy of this message | ||
Commit: 4f860a44126bf4cd87e7eb4eaa0ea4d44f96abc5
Author: Xinchen Hui <laruence@php.net> Tue, 2 Oct 2012 00:28:38 +0800
Parents: af0c22537a31af9e441f5889e26297dc8aa2187a
Branches: PHP-5.3
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4f860a44126bf4cd87e7eb4eaa0ea4d44f96abc5
Log:
Avoding superfluous function call
Changed paths:
M ext/standard/var.c
Diff:
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 3e2a45c..9934125 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -626,6 +626,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
HashPosition pos;
int i;
zval nval, *nvalp;
+ HashTable *propers;
ZVAL_NULL(&nval);
nvalp = &nval;
@@ -651,7 +652,8 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
smart_str_appendl(buf,"N;", 2);
continue;
}
- if (zend_hash_find(Z_OBJPROP_P(struc), Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *)
&d) == SUCCESS) {
+ propers = Z_OBJPROP_P(struc);
+ if (zend_hash_find(propers, Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *) &d) ==
SUCCESS) {
php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name));
php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC);
} else {
@@ -663,7 +665,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
do {
zend_mangle_property_name(&priv_name, &prop_name_length, ce->name,
ce->name_length, Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS);
- if (zend_hash_find(Z_OBJPROP_P(struc), priv_name, prop_name_length + 1, (void *) &d) ==
SUCCESS) {
+ if (zend_hash_find(propers, priv_name, prop_name_length + 1, (void *) &d) == SUCCESS) {
php_var_serialize_string(buf, priv_name, prop_name_length);
pefree(priv_name, ce->type & ZEND_INTERNAL_CLASS);
php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC);
@@ -671,7 +673,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
pefree(priv_name, ce->type & ZEND_INTERNAL_CLASS);
zend_mangle_property_name(&prot_name, &prop_name_length, "*", 1,
Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS);
- if (zend_hash_find(Z_OBJPROP_P(struc), prot_name, prop_name_length + 1, (void *) &d) ==
SUCCESS) {
+ if (zend_hash_find(propers, prot_name, prop_name_length + 1, (void *) &d) == SUCCESS) {
php_var_serialize_string(buf, prot_name, prop_name_length);
pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS);
php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC);