diff --git a/src/util/has.scad b/src/util/has.scad index 180d9bb3..0b4bee07 100644 --- a/src/util/has.scad +++ b/src/util/has.scad @@ -1 +1,6 @@ -function has(lt, elem) = search([elem], lt) != [[]]; \ No newline at end of file +use ; +use ; + +function has(lt, elem, sorted = false) = + sorted ? bsearch(lt, elem) != -1 : + search([elem], lt) != [[]]; \ No newline at end of file