com php-src: Remove redundant HASH_OF in mail.c: ex t/standard/mail.c

From: Date: Thu, 11 Oct 2018 11:04:08 +0000
Subject: com php-src: Remove redundant HASH_OF in mail.c: ex t/standard/mail.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-103433@lists.php.net to get a copy of this message
Commit: a27f772a460fff294374ae4b7a5158a52dae4c6a Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 11 Oct 2018 13:01:34 +0200 Parents: 4ca5b357717ccf79b86966d04fc03287e551acdc Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a27f772a460fff294374ae4b7a5158a52dae4c6a Log: Remove redundant HASH_OF in mail.c And use ZEND_HASH_FOREACH_STR_KEY_VAL where the integer key is not needed. Changed paths: M ext/standard/mail.c Diff: diff --git a/ext/standard/mail.c b/ext/standard/mail.c index ca6ca11..497a293 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -162,12 +162,10 @@ static void php_mail_build_headers_elem(smart_str *s, zend_string *key, zval *va static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *val) { - zend_ulong idx; zend_string *tmp_key; zval *tmp_val; - (void)(idx); - ZEND_HASH_FOREACH_KEY_VAL(HASH_OF(val), idx, tmp_key, tmp_val) { + ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(val), tmp_key, tmp_val) { if (tmp_key) { php_error_docref(NULL, E_WARNING, "Multiple header key must be numeric index (%s)", ZSTR_VAL(tmp_key)); continue; @@ -190,7 +188,7 @@ PHPAPI zend_string *php_mail_build_headers(zval *headers) ZEND_ASSERT(Z_TYPE_P(headers) == IS_ARRAY); - ZEND_HASH_FOREACH_KEY_VAL(HASH_OF(headers), idx, key, val) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(headers), idx, key, val) { if (!key) { php_error_docref(NULL, E_WARNING, "Found numeric header (" ZEND_LONG_FMT ")", idx); continue;

« previous php.cvs (#103433) next »