[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-22 13:09:57 CET

Max Bowsher wrote:
>
> Read the docstring carefully. You are confusing *keys* and *values*.
>

I'm just not seeing that:

/**
  * Look up the value associated with a key in a hash table.
  * @param ht The hash table
  * @param key Pointer to the key
  * @param klen Length of the key. Can be APR_HASH_KEY_STRING to use the string
length.
  * @return Returns NULL if the key is not present.
  */
APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
                                  apr_ssize_t klen);

That code (which I inherited from plasma's original patch and didn't really
touch) is looping over the keys of lame_a, then using apr_hash_get() to compare
the values associated with each key in both hashes.

Granted, the code is suboptimal, since I could be using apr_hash_this() to
directly retrieve the value from the first hash, but I don't see how I can get
the value associated with that key in the other hash without using apr_hash_get().

I'll go and read through your changed patch after I have breakfast and see how
you did it...

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 22 13:08:11 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.