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

Re: APR hash tables, restated

From: Karl Fogel <kfogel_at_galois.collab.net>
Date: 2000-10-13 21:50:36 CEST

Greg Stein <gstein@lyra.org> writes:
> Untrue. These two statements are different:
>
> apr_hash_get(ht, "", 0);
> apr_hash_get(ht, "", 1);
>
> The former is a zero-length key, the latter is a length of 1 containing a
> the value zero.
>
> Think about how the key and length are handled:
>
> if (len == 0)
> len = strlen(key);

It's that the docs says APR adds 1 to the computed length...

> What I plan to do is introduce -1 to mean "compute the strlen for me" rather
> than using 0 to do that (since we want 0 to be a legal key length).

Sounds like a good solution.
Received on Sat Oct 21 14:36:11 2006

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.