diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-06-04 02:11:26 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-06-04 02:11:26 +0400 |
commit | 6e7338700e8df8285c1d352b249e4970e35df472 (patch) | |
tree | 4e62ee6a549b063620ab24f7d7bcd929927f5e77 /ext/mysql | |
parent | 3f6f0d5a700a7de777336569846fa2bfe23c667c (diff) | |
download | php-git-6e7338700e8df8285c1d352b249e4970e35df472.tar.gz |
Avoid useless merge
Diffstat (limited to 'ext/mysql')
-rw-r--r-- | ext/mysql/php_mysql.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 580296a3cf..588eaf0539 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -2171,8 +2171,14 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, ZVAL_COPY_VALUE(&dataset, return_value); object_and_properties_init(return_value, ce, NULL); - zend_merge_properties(return_value, Z_ARRVAL(dataset), 0 TSRMLS_CC); - zval_dtor(&dataset); + if (!ce->default_properties_count && !ce->__set) { + ALLOC_HASHTABLE(Z_OBJ_P(return_value)->properties); + *Z_OBJ_P(return_value)->properties = *Z_ARRVAL(dataset); + efree(Z_ARR(dataset)); + } else { + zend_merge_properties(return_value, Z_ARRVAL(dataset) TSRMLS_CC); + zval_dtor(&dataset); + } if (ce->constructor) { fci.size = sizeof(fci); |