[fpc-devel] String cases development
Peter Vreman
peter at freepascal.org
Tue May 5 17:19:19 CEST 2009
>
>
> Op Tue, 5 May 2009, schreef Michael V. Denisenko:
>
>> A question appeared when I tried to find a method of generating
>> case-expression just once, not for every comparison. Is it optimal to
>> try to add for every case-structure (and do...while, by the way) a
>> temporary variable where we may hold the value of case-expression?
>
> Yes, but it only if the variable part of the case expression is complex,
> i.e. not a simple loadn or perhaps subscriptn of a simple loadn.
In pstatmnt.pas _with_statement() function there is code that also already provides the same
functionality for the with statement. This code can be generalized and reused.
Peter
More information about the fpc-devel
mailing list