]> granicus.if.org Git - php/commitdiff
Special case for last iteration
authorDmitry Stogov <dmitry@php.net>
Wed, 21 Feb 2007 14:11:00 +0000 (14:11 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 21 Feb 2007 14:11:00 +0000 (14:11 +0000)
Zend/zend_hash.c

index a5faafefed41f3bd5f5bce902db4d1d0215f3edf..c3e0ae43948af8572094fedadcf31d7b18ddf6d5 100644 (file)
@@ -1025,7 +1025,9 @@ ZEND_API int zend_hash_get_pointer(HashTable *ht, HashPointer *ptr)
 
 ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr)
 {
-       if (ht->pInternalPointer != ptr->pos) {
+       if (ptr->pos == NULL) {
+               ht->pInternalPointer = NULL;
+       } else if (ht->pInternalPointer != ptr->pos) {
                Bucket *p;
 
                IS_CONSISTENT(ht);