> -----Original Message-----
> From: Ian Holsman [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 21, 2001 6:03 PM
> To: Brian Pane
> Cc: [email protected]
> Subject: Re: [PATCH] optimization for hash tables and pool userdata
> 
> 
> On Sat, 2001-11-17 at 23:35, Brian Pane wrote:
> > This patch speeds up the apr_hash_t implementation's
> > handling of APR_HASH_KEY_STRING.
> > 
> > Index: srclib/apr/tables/apr_hash.c
> > +    if (klen == APR_HASH_KEY_STRING) {
> > +        for (p = key; *p; p++) {
> > +            hash = hash * 33 + *p;
> > +        }
> > +        klen = p - (const unsigned char *)key;
> > +    }

How about to add here something like:
(in apr_hash.h add #define APR_HASH_KEY_UCASE     (-2)

+    else if (klen == APR_HASH_KEY_UCASE) {
+        for (p = key; *p; p++) {
+            hash = hash * 33 + apr_tolower(*p);
+        }
+        klen = p - (const unsigned char *)key;
+    }

that will give you the case insensitive hash table


> > +    else {
> > +        for (p = key, i = klen; i; i--, p++) {
> > +            hash = hash * 33 + *p;
> > +        }
> > +    }

Reply via email to