Re: [fpc-devel] fpc-devel Digest, Vol 178, Issue 38

2019-02-21 Thread Franz Müller
Well one of the answer in the Cantu blog has this ( which I changed to lets say a "real world" relative big function ) : var arr: array... function Fuckup: boolean; var I: Integer; begin  <> 20 lines of code  for var I := Low(arr) to High(arr) do if arr[I]. then break; <> 20 lines

Re: [fpc-devel] Sorry for poor testing

2019-01-16 Thread Franz Müller
Hi! I have a proposition for optimizing big case statements with sparse case labels. Have you already thought of using a hash function to drastically reduce the size of the jump table? I have made some tests. For example, assume a case statement with 80 values for case labels in the range

[fpc-devel] Custom sorted stringlists

2019-01-14 Thread Franz Müller
Hi, after a lot of testing, I think it is safe and I have submitted this patch to the bugtracker https://bugs.freepascal.org/view.php?id=34873 With this patch, it is possible to provide a custom compare function to a stringlist and thus allow the stringlist to keep the items automatically

Re: [fpc-devel] Stringlist sortstyle ssluser

2018-12-28 Thread Franz Müller
On Wed, 26 Dec 2018, Franz Müller wrote: In the current implementation of TStringlist, there is a property SortStyle, which is somewhat similar to the property Sorted. However, it is different from sorted in that it allows 3 values: sslnone, which corresponds to sorted=false, sslAuto, which

[fpc-devel] Stringlist sortstyle ssluser

2018-12-27 Thread Franz Müller
In the current implementation of TStringlist, there is a property SortStyle, which is somewhat similar to the property Sorted. However, it is different from sorted in that it allows 3 values: sslnone, which corresponds to sorted=false, sslAuto, which corresponds to sorted=true, and sslUser,

Re: [fpc-devel] fpc-devel Digest, Vol 176, Issue 32

2018-12-23 Thread Franz Müller
Am Sa., 22. Dez. 2018, 17:38 hat Bart <mailto:bartjun...@gmail.com>> geschrieben: On Sat, Dec 22, 2018 at 1:03 PM Franz Müller mailto:b...@gmx.at>> wrote: > But maybe there is an easy way to save the state of the random number generator routine before sorting and

[fpc-devel] STringlist: Randomization problem

2018-12-23 Thread Franz Müller
Just thought of it again. If we make the quicksort procedure virtual protected instead of private, it would be easy for anyone who needs it to derive a stringlist class in which quicksort makes the pivot choice without using the random routine. To avoid the performance penalty of the

[fpc-devel] Fwd: Re: fpc-devel Digest, Vol 175, Issue 29

2018-12-22 Thread Franz Müller
Hi, I have finished work on the improved stringlist. There are few changes in the public section:  A new public property OnCompareItems: TStringListSortCompare allows to define the compare function, while keeping sslAuto as sortstyle. If OnCompareItems uses data from the object instead of or

Re: [fpc-devel] Stringlist customsort

2018-12-03 Thread Franz Müller
@Tomas Hajny Ah - thank you. Very strange. I did not expect and did not notice that when I click on "reply to list", the reply uses another mail address than the one the mail was sent to. Looks like an error of the thunderbird mailprogramm, I think replies should always use the same mail

Re: [fpc-devel] Stringlist customsort

2018-12-02 Thread Franz Müller
Am 01.12.2018 um 09:09 schrieb fpc-devel-requ...@lists.freepascal.org: That sounds as if you have an implementation ready ? If so, please submit a patch to the bugtracker. I'll evaluate it and if it is indeed simple, as you claim, I will apply the patch. Michael. Havent programmed it yet,

[fpc-devel] Stringlist customsort

2018-11-30 Thread Franz Müller
Hi everybody! Currently, the implementation of cutomsorted stringlists ist very far from satisfactory; you have to call the sort routine again whenever a string is added to the stringlist or an item is changed, because the stringlist cannot keep itself automatically sorted using a custom

[fpc-devel] Stringlist customsort

2018-11-29 Thread Franz Müller
Hi everybody! Currently, the implementation of cutomsorted stringlists ist very far from satisfactory; you have to call the sort routine again whenever a string is added to the stringlist or an item is changed, because the stringlist cannot keep itself automatically sorted using a custom