[fpc-devel] Patch to speed up Uppercase/Lowercase functions

Jonas Maebe jonas at zeus.ugent.be
Fri Jun 10 23:27:00 CEST 2005


On 10 jun 2005, at 23:05, Luiz Américo wrote:

> BTW, in the snippet below, Length(S) is called once or at each  
> iteration?
>
> for i := Length(S) downto 1 do

Once. Since it is the start value, that is even quite logical.  
However, even if it appeared in the end condition it would also be  
only calculated once at the start of the loop. This is even required  
for correctness, because it's possible to do something like

i := 5
for i := 1 to array_var[i] do


Jonas



More information about the fpc-devel mailing list