1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-18 22:58:04 +01:00

by supports a function literal

This commit is contained in:
Justin Lin 2021-02-07 12:13:32 +08:00
parent 635b946ede
commit 3ce7468acc

View File

@ -35,4 +35,4 @@ function _sort_by_cmp(lt, cmp) =
before = [for(j = 1; j < leng; j = j + 1) if(cmp(lt[j], pivot) < 0) lt[j]],
after = [for(j = 1; j < leng; j = j + 1) if(cmp(lt[j], pivot) >= 0) lt[j]]
)
concat(_sort_by_cmp(before, cmp), [pivot], _sort_by_cmp(after, cmp));
concat(_sort_by_cmp(before, cmp), [pivot], _sort_by_cmp(after, cmp));