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

Re: Using svn_hash__make instead of apr_hash__make

From: Hyrum K Wright <hyrum.wright_at_wandisco.com>
Date: Tue, 22 May 2012 16:59:10 -0500

On Tue, May 22, 2012 at 2:35 PM, Stefan Fuhrmann <eqfox_at_web.de> wrote:
>...
> On a more general note: We don't use hashes as a means to
> randomize our data. For us, they are simply containers with
> an average O(1) insertion and lookup behavior. The APR interface
> also allows for iterating that container - so it *has* an ordering
> and it has been quite stable under different operations and
> over many versions of APR.

I think that's the key insight here: dictionary data structures
shouldn't be depended upon to have a stable ordering. Almost any
generic key-value mapping type doesn't make that guarantee, and yet
we've gotten into the bad habit of assuming it. When the underlying
assumption became invalid, there went our code. In some ways, I guess
we had it coming.

In the long run, the problem is one of deciding out what output really
should be canonically sorted, and then doing so. I'm not volunteering
for the effort, but attempts to monkey with the underlying data
structure are *not* the way to go.

-Hyrum

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Received on 2012-05-22 23:59:42 CEST

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