From 8a528e2e2b23bce676728f5c912bc7f422984e79 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 11 Mar 2022 22:18:26 +0800 Subject: [PATCH] refactor --- src/util/_impl/_vt_default_comparator.scad | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/_impl/_vt_default_comparator.scad b/src/util/_impl/_vt_default_comparator.scad index 263fa155..0b2686f1 100644 --- a/src/util/_impl/_vt_default_comparator.scad +++ b/src/util/_impl/_vt_default_comparator.scad @@ -1,8 +1,8 @@ function _greaterThan(elem1, elem2, i) = - i == -1 ? false : - elem1[i] > elem2[i] ? true : - elem1[i] != elem2[i] ? false : _greaterThan(elem1, elem2, i - 1); + i >= 0 && ( + elem1[i] > elem2[i] || (elem1[i] == elem2[i] && _greaterThan(elem1, elem2, i - 1)) + ); function greaterThan(elem1, elem2) = _greaterThan(elem1, elem2, len(elem1) - 1); - + function lessThan(elem1, elem2) = !greaterThan(elem1, elem2) && elem1 != elem2; \ No newline at end of file