> At 03:31 AM 5/12/01 +0300, Zeev Suraski wrote:
> >Yikes.  We were only kidding, Jason :)
>
> Well, he could have the last argument of zend_hash_update() to receive the 
> point to inserted value and done refcount++ on that and inserted again. ;-)
The only thing with that method is that I was trying to place the hash table
in true stat order, so that all the numeric keys are before the string keys, so
that someone could easily move to the next element without getting a duplicate value.

I suppose I could have created another zval * for each insret to catch the pointer the 
returned value,
but I was trying to make the code is clean as possible, and it just seemed easier to 
start off declaring the zval with  another refcount.

> I've been thinking we need to have add_* functions returning the pointer to 
> inserted value somehow.. Plus the set of corresponding functions for 
> retrieving data easily.
> -Andrei
> 
I agree, it seems that the add_ functions are so high level that it is common to 
switch to using the hash functions. However, the hash functions are often too low 
level,
and add a lot of complexity. Some enhanced add functions would  help out alot 
if nothing more then helping readibility of code : )

-Jason




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to