[Gambas-user] Get distinct array from large array
Martín Belmonte
mbelmonte at belmotek.net
Fri Dec 10 13:39:09 CET 2021
El 10/12/21 a las 11:37, Tobias Boege via User escribió:
> In theory, the following should be faster (at the expense of using more
> memory for the added Collection), but please do try it out on real data:
>
> 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
ok, I made a sample for test the fastest function (see attachments) an
one screen shoot.
Next, email I will send the test for 3.17 c.Keys that you say.
atb
Martín
-------------- next part --------------
A non-text attachment was scrubbed...
Name: the-fastest-0.0.1.tar.gz
Type: application/gzip
Size: 13081 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20211210/d384bb2c/attachment-0001.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fastest.png
Type: image/png
Size: 75558 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20211210/d384bb2c/attachment-0001.png>
More information about the User
mailing list