[fpc-pascal] When is AnsiString not a good substitute for string?
Jürgen Hestermann
juergen.hestermann at gmx.de
Mon Mar 22 07:33:29 CET 2010
> Jorge Aldo G. de F. Junior schrieb:
> actually, for most porpuses, ansistring is a lot faster than normal
> strings with size 255...
> you pass around 4 bytes instead of 256...
That would be only true if you have multiple variables pointing to the same string without changing each instance. I don't believe that this the majority of code. Why would you use multiple variables then? After assigning the value of an AnsiString to another AnsiString variable I *always* modify it. And then the whole data gets copied too plus additional overhead like increasing the reference counter.
More information about the fpc-pascal
mailing list