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/soap/php_encoding.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ext/soap/php_encoding.c') diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 12f23bf0e2..36d0f80249 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2273,8 +2273,11 @@ static void add_xml_array_elements(xmlNodePtr xmlParam, static inline int array_num_elements(HashTable* ht) { - if (ht->pListTail && ht->pListTail->nKeyLength == 0) { - return ht->pListTail->h-1; + if (ht->nNumUsed && + ht->arData[ht->nNumUsed-1].xData && + ht->arData[ht->nNumUsed-1].nKeyLength == 0) { + + return ht->arData[ht->nNumUsed-1].h - 1; } return 0; } -- cgit v1.2.1