[fpc-pascal] sort procedure of T(FP)List

Geno Roupsky groupsky at gmail.com
Sat May 6 18:36:43 CEST 2006


2006/5/6, Marc Santhoff <M.Santhoff at t-online.de>:
>
> Am Freitag, den 05.05.2006, 11:03 +0300 schrieb Geno Roupsky:
> > In fact you could have different function for every kind of sort and
> > switch them on the fly when the properties determining the kind of
> > sort that should be made changes. In my experience there is no much
> > code duplication involved in this technique and you could make for
> > example one compare function for every field, after that you make a
> > _complex_ ones calling the simple ones.
>
> The only thing I'm afraid of is stumbling into threading issues in the
> future (most likely when I have fogotten the details of sorting ;).


It is the response of the compare function not the sorting one to
synchronize whatever global(outside it's scope) variables is accesses, so no
matter what approach you take you still will have issues with threads.

--
Geno Roupsky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20060506/333b087f/attachment.html>


More information about the fpc-pascal mailing list