ARTparse question

Russ Allbery rra at stanford.edu
Mon Dec 29 04:16:44 UTC 2003


Forrest J Cavalier <mibsoft at epix.net> writes:

> Is it my misunderstanding that the ARTparse code for parsing headers has
> a for() loop which does an unnecessary inefficient search.

> The code reads:

>     for (; i < limit ;) {
>       if (data->LastCRLF + 1 == i) {
>          ... code block here ...
>       }
>       i++;
>     }

> If there are no label statements inside the code block and no
> assignments to i, couldn't that run much more efficiently as:

I *think* so... I'm not sure how the label at the end of the outside for
loop might enter into it.

> Why the incremental search of i?

I don't understand that code all that well; I keep meaning to really study
it but haven't found the time.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list