mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-01-17 22:28:16 +01:00
refactor
This commit is contained in:
parent
8a528e2e2b
commit
c76766f5b4
@ -1,8 +1,12 @@
|
||||
function _greaterThan(elem1, elem2, i) =
|
||||
i >= 0 && (
|
||||
elem1[i] > elem2[i] || (elem1[i] == elem2[i] && _greaterThan(elem1, elem2, i - 1))
|
||||
function greaterThan(elem1, elem2) =
|
||||
let(
|
||||
leng = len(elem1),
|
||||
lt = [for(i = leng - 1; i > -1 && elem1[i] == elem2[i]; i = i - 1) i],
|
||||
leng_lt = len(lt)
|
||||
)
|
||||
leng_lt < leng && (
|
||||
let(i = leng_lt == 0 ? leng - 1 : lt[leng_lt - 1] - 1)
|
||||
elem1[i] > elem2[i]
|
||||
);
|
||||
|
||||
function greaterThan(elem1, elem2) = _greaterThan(elem1, elem2, len(elem1) - 1);
|
||||
|
||||
function lessThan(elem1, elem2) = !greaterThan(elem1, elem2) && elem1 != elem2;
|
Loading…
x
Reference in New Issue
Block a user