[fpc-devel] SetLength() vs := ''

Daniël Mantione daniel.mantione at freepascal.org
Fri Nov 9 11:50:33 CET 2007



Op Fri, 9 Nov 2007, schreef Graeme Geldenhuys:

> Hi,
> =

> Is SetLength(StringVar, 0);       faster than     StringVar :=3D '';     =
  ?
> =

> =

> I see quite a bit of code in fpdoc use SetLength() rather than :=3D ''
> so I just wondered...

As far as I know the compiler has code to detect :=3D'' and optimize it. So =

it should not matter.

Dani=EBl


More information about the fpc-devel mailing list