Since this happens for each request, doing a string copy seems wasteful to me; it's extra overhead that is avoided with the current impl. Instead, we have an extra assignment and check, which is less expensive.
I originally toyed with doing the string copy, but instead opted for a more pointer oriented solution. Ruediger Pluem wrote: > > > > On 11/01/2005 02:05 PM, Jim Jagielski wrote: > > I wanted to avoid making string copies when possible. Plus, we > > Ok. That was one point of my question as I saw the need to copy the > string as a drawback compared to your approach. I was only unsure how > much this counts. > > > don't want to lowercase the URL, since that means /Foo/bar > > would be the same as /FOO/Bar, which is wrong :) > > Sure, but I actually do not do this. I only lowercase scheme and hostname, > because > I temporarily terminate my copied string with \0 before I lower case it. So > from > the functional point of view my approach should do the same as yours. The > question > was more about which solution > > - is faster > - is more easy to understand if both versions are equally fast > > Regards > > Rüdiger > > [..cut..] > -- ======================================================================= Jim Jagielski [|] [EMAIL PROTECTED] [|] http://www.jaguNET.com/ "If you can dodge a wrench, you can dodge a ball."
