apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bp...@pacbell.net>
Subject Re: [Patch] Add apr_hash_overlay
Date Tue, 17 Jul 2001 18:09:29 GMT
Ian Holsman wrote:

> Brian Pane wrote:
>> Ian Holsman wrote:
>>> any comments on this  patch? 
>> I just read through it, and I have one major and one minor
>> issue:
>> 1. Is it just my imagination, or is the overlay logic backwards?
>>   It looks like you're making a copy of "overlay" and then
>>   writing elements from "base" on top of it.  Shouldn't it be
>>   the opposite? 
> it provides the same calling interface as the table overlay (which is 
> also backwards IMHO)
> as it is intended to do the same thing as the table function. 
> (apr_table_overlay) 

But apr_table_overlay yields different results becasue of the
order in which apr_table_get searches the table.  By putting the
'overlay' elements in front of the 'base' elements, the 'overlay'
version of an entry is the one that apr_table_get finds.  In order
to duplicate this behavior with a hash table, I think you need to
copy the 'base' table into the result and then write the 'overlay'
table on top of it.


View raw message