[Lazarus] Lazarus support for Sorting is completely inadequate.

Juha Manninen juha.manninen62 at gmail.com
Sun Dec 2 00:53:26 CET 2012


The default sort routine is quicksort and it works well in every situation.
It uses a compare function which returns -1, 0 or 1 depending on its parameters.
You need different compare functions, not different sort functions to
support the languages.
Mattias tried to explain it already.
There could also be other sort functions / algorithms like merge sort
or even bubble sort, but that is another issue.

Otherwise the idea was good. All GUI controls and maybe StringList,
too, should use the same locale specific compare function.

Having separate quicksort routines in many containers is not as bad as
it sounds. The quicksort routine is short and well-established (will
not change) and it must use the container's data directly inside a
tight loop.

Juha




More information about the Lazarus mailing list