[Gambas-user] Get distinct array from large array

Martín Belmonte mbelmonte at belmotek.net
Fri Dec 10 14:46:26 CET 2021


El 10/12/21 a las 13:39, Martín Belmonte escribió:
> El 10/12/21 a las 11:37, Tobias Boege via User escribió:
>>    Public Function Deduplicate(xxx As String[]) As String[]
>>      Dim yyy As New String[]
>>      Dim stash As New Collection
>>
>>      For Each x As String in xxx
>>        If stash.Exist(x) Then Continue
>>        stash[x] = True
>>        yyy.Add(x)
>>      Next
>>      Return yyy
>>    End
> Next, email I will send the test for 3.17 c.Keys that you say.

ok, I made the test it's steel the best performance Deduplicate()
Deduplicate = 274.900 micro seconds
Deduplicate317 = 282.634 micro seconds
For 1 million items.

Thanks Tobias, i will replace my Deldup() function in my "toolbox" by yours.

atb
Martín.


More information about the User mailing list