diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-02-10 10:04:30 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-02-10 10:04:30 +0400 |
commit | f4cfaf36e23ca47da3e352e1c60909104c059647 (patch) | |
tree | 0db3e2a323b12c5bbf1a958c857f92eb58c240d1 /ext/mysql/php_mysql.c | |
parent | 89a9acea1f9d821a9805b3857bf4febbba08690d (diff) | |
download | php-git-f4cfaf36e23ca47da3e352e1c60909104c059647.tar.gz |
Use better data structures (incomplete)
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r-- | ext/mysql/php_mysql.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 3d092b2d6a..a00e98fbbc 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -2176,14 +2176,15 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) { if (Z_TYPE_P(ctor_params) == IS_ARRAY) { HashTable *htl = Z_ARRVAL_P(ctor_params); + uint idx; Bucket *p; fci.param_count = 0; fci.params = safe_emalloc(sizeof(zval*), htl->nNumOfElements, 0); - p = htl->pListHead; - while (p != NULL) { - fci.params[fci.param_count++] = (zval**)p->pData; - p = p->pListNext; + for (idx = 0; idx < htl->nNumUsed; idx++) { + p = htl->arData + idx; + if (!p->xData) continue; + fci.params[fci.param_count++] = (zval**)&p->xData; } } else { /* Two problems why we throw exceptions here: PHP is typeless |