[Mono-dev] Reverted patch 55895
Miguel de Icaza
miguel at novell.com
Sun Jan 22 15:27:48 EST 2006
> > My suggestion is that you add at the end of the routine a call to
> > capitalize the string properly, so if we fail to find a match for a
> > string, say "content-lenght", it then capitalizes it properly and tries
> > the switch again (there is one special case to handle, header "TE", but
> > that is all).
> Actually, for the case insensitive path, I'd just use a hashtable (with
> a case-insensitive hashcode). That avoids *any* allocations (and avoids
> a linear search which one would get with using String.Compare).
> I'm not sure if this routine is performance critical enough to justify
> having two hashtables, one for a faster case sensitive compare and
> another for a correct insensitive comparison.
> In general, we shouldn't use ToLower/ToUpper for the purpose of case
> insensitive comparisons.
This is a fine optimization for the fall-back, but the default should
remain as it is.
More information about the Mono-devel-list