From: Ilia Alshanetsky Date: Fri, 6 Feb 2004 03:07:59 +0000 (+0000) Subject: Do not initialize & create vars unless they will be used. X-Git-Tag: php-5.0.0b4RC1~108 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1eb6a182898cb0011d35cbf9b66755cfc93edaa5;p=php Do not initialize & create vars unless they will be used. --- diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c index bc867b1230..820866ccd5 100755 --- a/ext/spl/spl_functions.c +++ b/ext/spl/spl_functions.c @@ -106,10 +106,10 @@ void spl_register_property( zend_class_entry * class_entry, char *prop_name, zva /* {{{ spl_add_class_name */ void spl_add_class_name(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC) { - size_t len = strlen(pce->name); - zval *tmp; - if (!allow || (allow > 0 && pce->ce_flags & ce_flags) || (allow < 0 && !(pce->ce_flags & ce_flags))) { + size_t len = strlen(pce->name); + zval *tmp; + if (zend_hash_find(Z_ARRVAL_P(list), pce->name, len+1, (void*)&tmp) == FAILURE) { MAKE_STD_ZVAL(tmp); ZVAL_STRING(tmp, pce->name, 1);