[Lazarus] How to use strings properly with fixes_1_6 and FPC 3.0.0?

Jürgen Hestermann juergen.hestermann at gmx.de
Fri Oct 21 16:08:32 CEST 2016


Am 2016-10-21 um 14:59 schrieb Juha Manninen via Lazarus:
 > On Fri, Oct 21, 2016 at 3:24 PM, Gabor Boros via Lazarus
 > <lazarus at lists.lazarus-ide.org> wrote:
 >> Why the below example better than a for loop with UTF8Length and UTF8Copy
 >> for go through the string?
 > Because it is MUCH faster. It scales linearly, O(n).
 > Calling UTF8Length() and UTF8Copy() inside the loop makes it
 > polynomial O(n^2) or worse depending on how many UTF8...() calls you
 > have there.

And again we are at the point where you need to understand what goes on under the hood... ;-)




More information about the Lazarus mailing list