Re: cvs: php4 /ext/standard array.c

From: Date: Sat, 03 Aug 2002 12:17:30 +0000
Subject: Re: cvs: php4 /ext/standard array.c
References: 1 2 3  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13103@lists.php.net to get a copy of this message
At 01:48 PM 8/3/2002 +0200, Thies C. Arntzen wrote:
On Sat, Aug 03, 2002 at 12:19:32PM +0300, Andi Gutmans wrote: At 04:38 AM 8/1/2002 +0000, Brad LaFountain wrote: snipp
+       // If we did a shift... re-index like it did before
+       if(!off_the_end) {
+               HANDLE_BLOCK_INTERRUPTIONS();
+               {
+                       int k = 0;
+                       Bucket *p = Z_ARRVAL_PP(stack)->pListHead;
+                       while (p != NULL) {
+                               if (p->nKeyLength == 0)
+                                       p->h = k++;
+                               p = p->pListNext;
+                       }
+                       Z_ARRVAL_PP(stack)->nNextFreeElement = k+1;
+                       zend_hash_rehash(Z_ARRVAL_PP(stack));
+               }
+               HANDLE_UNBLOCK_INTERRUPTIONS();
+       }
Brad, I think it kind of sucks to have code which manipulates the hash directly in PHP. If this is really needed then it should be made a function in zend_hash.*
    i kinda agree with andi, but i also know that we can certain
    function _much_ faster by knowing the internals. so -andi-
    what kind of an API could be exposed to make things
    leaner/faster?
We could add something like zend_hash_renumber_indeces(). Andi

« previous php.cvs (#13103) next »