[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: apr_hash_overlay returns hash with duplicate keys

From: Branko ─îibej <brane_at_apache.org>
Date: Fri, 11 Dec 2015 02:12:08 +0100

On 10.12.2015 18:23, Ivan Zhakov wrote:
> I think returning
> hash with non-standard hash function from public API is a bug (and API
> regression). Other API users may get to the same situation. So proper
> fix would be revert these optimizations from public API imo.

I really can't agree with this. A user of the APR public API cannot
assume which hash function is used by any instance of apr_hash_t that
she did not create herself. In other words, no-one should be calling
apr_hash_overlay() (with APR <= 1.4.5) unless they know that the hashes
use the same hash function.

The only "bug" here is a design bug in older versions of
apr_hash_overlay() (and apr_hash_merge()), and even that is debatable.

As far as the Subversion code is concerned, we should, IMO, be using
svn_hash__make() everywhere, since we have it.

-- Brane
Received on 2015-12-11 02:12:19 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.