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@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... ;-) -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus