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

Re: [PATCH] Keywords as hash - final code patch

From: John Peacock <jpeacock_at_rowman.com>
Date: 2005-03-21 23:27:01 CET

Julian Foad wrote:
>> + * @a a and @a b are hashes mapping @c (const char *) keyword names
>> to + * @c (const * char *) keyword values.
>
>
> Spurious star. Instead:
>

Indeed, I thought I had fixed that cut/paste error... <blush>

>> +
>> + if (((a == NULL) && (b == NULL)) /* no A or B */
>> + || ((a == NULL) && (b != NULL)) /* no A but B */
>> + || ((a != NULL) && (b == NULL)) /* no B but A */
>
>
> Those three lines simplify to:
>
> if (((a == NULL) || (b == NULL)) /* no A or no B */
>
> but actually that's not what you want because...
>
>> + /* Unequal number of contents */
>> + || (apr_hash_count(lame_a) != apr_hash_count(lame_b)))
>> {
>> - return FALSE;
>> + return TRUE;
>
>
> ... you've changed the result of ((a == NULL) && (b == NULL)) here, now
> saying
> that they differ.

Yes, that was the mistake I though Max was talking about. I was trying
to combine the NULL test with the apr_hash_count test and wanted to be
absolutely sure that a NULL hash was not passed to apr_hash_count()
which will rightly object. I went all boolean and not only got too
complicated, I ultimately got it wrong.

Thanks for the gentle dope slap...

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 22 00:36:02 2005

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.