Compare function are very slow. To achieve the same sort capability,
a function like this is much more efficient :
multi-sort: func [
serie [series!]
order [block!]
/local
][
foreach local reverse order [
either negative? local [
serie: sort/skip/compare/reverse serie length? order abs local
] [
serie: sort/skip/compare serie length? order reduce local
]
]
serie
]
Example :
>> multi-sort [1 2 1 2 1 3 2 1 2 2] [-1 2]
== [2 1 2 2 1 2 1 2 1 3]
>> multi-sort [1 2 1 2 1 3 2 1 2 2] [1 -2]
== [1 3 1 2 1 2 2 2 2 1]
>>
2 johnsjvi95 9-Sep-2021 9:31
This is interesting! Will save this for future reference.
pinjaman dana jaminan bpkb mobil cepat hanya 1 hari bisa langsung cair dengan suku bunga rendah serta tanpa survey dan bpkb mobil aman untuk seluruh wilayah indonesia.