19.02.2012 18:38, Mattias Gaertner пишет:
Hi,

When I use "copy" on a PChar (e.g. copy(p,1,1)), it is very slow,
because the compiler converts the PChar to a string.

Not sure why it is allowed in the first place. If out of Delphi compatibility, maybe we should leave it enabled for {$mode delphi} only (should be possible because copy is partially handled by compiler).

Is there already a function for PChar?

Can an overloaded version of copy be added?

It is a question how to interpret indices then (PChar is zero-based while 
strings are 1-based).
And actually it will mean 4 overloads: PChar, PWideChar, array of char, array 
of widechar.

Regards,
Sergei
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to