diff --git a/src/util/has.scad b/src/util/has.scad index 66466c13..c0326fda 100644 --- a/src/util/has.scad +++ b/src/util/has.scad @@ -8,4 +8,8 @@ * **/ -function has(lt, elem) = search([elem], lt) != [[]]; \ No newline at end of file +use ; + +function has(lt, elem, sorted = false) = + sorted ? bsearch(lt, elem) != -1 : + search([elem], lt) != [[]]; \ No newline at end of file