[fpc-pascal] Empty string
Damien Gerard
milipili at shikami.org
Fri Mar 7 15:52:01 CET 2008
Le Mar 7, 2008 à 3:35 PM, John Coppens a écrit :
> On Fri, 7 Mar 2008 15:09:36 +0100
> Damien Gerard <milipili at shikami.org> wrote:
>
>> Consequently, it can not be the same code. Otherwise I understood
>> nothing :)
>
> '' is an empty string, _and_ its length is zero (of course). So the
> compiler is so intelligent as to replace length(s) = 0, or s = ''
> by the same code.
>
> Normally s = '' would be a very slow way to check for an empty
> string, so
> the compiler optimizes this automatically.
Thanks !
Sorry for my question not so clear :)
--
Damien Gerard
milipili at shikami.org
"Intelligence is 10 million rules."
-- Douglas Lenat
More information about the fpc-pascal
mailing list