Re: [MERGE] string-fix initial merge, take 2

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Thu, 05 Feb 2009 23:47:41 +0100

tor 2009-02-05 klockan 12:08 +0100 skrev Kinkie:
> Hi all,
> here's a re-take of the string-fix initial merge.
>
> Compared to the retired first attempt it:
> - fixes the issues Tsantilas Christos found out about
> - implements String::find
> - some more users analyzed and fixed.
>
> For what's worth, I'm running this branch for my personal environment,
> and it hasn't bombed on me (yet).

Looks nice.

But there is still room for obvious improvement.

strstr is pos().

- if (strstr (sctusable->content.buf(), "ESI/1.0"))

to

+ if (sctusable->content.pos("ESI/1.0"))

String has a copy constructor

- varState->feedData(unevaluatedVariable.buf(), unevaluatedVariable.size());

to

+ varState->feedData(unevaluatedVariable);

- ESISegment::ListAppend (state.getOutput(), S.buf(), S.size());

could use a ListAppend method taking a String const & argument to isolate this. Done at many places.

     return httpHdrExtFieldDoCreate(
- f->name.buf(), f->name.size(),
- f->value.buf(), f->value.size());
+ f->name.rawBuf(), f->name.size(),
+ f->value.rawBuf(), f->value.size());

Same here... those are String

but all this is further improvements along the same path.

Regards
Henrik
Received on Thu Feb 05 2009 - 22:47:48 MST

This archive was generated by hypermail 2.2.0 : Fri Feb 06 2009 - 12:00:03 MST