From f4cfaf36e23ca47da3e352e1c60909104c059647 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 10 Feb 2014 10:04:30 +0400 Subject: Use better data structures (incomplete) --- ext/mysql/php_mysql.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ext/mysql/php_mysql.c') 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 -- cgit v1.2.1