mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-12 09:44:16 +02:00
use binary search if lt is sorted by z, y, x
This commit is contained in:
@@ -1 +1,6 @@
|
||||
function has(lt, elem) = search([elem], lt) != [[]];
|
||||
use <util/sort.scad>;
|
||||
use <util/bsearch.scad>;
|
||||
|
||||
function has(lt, elem, sorted = false) =
|
||||
sorted ? bsearch(lt, elem) != -1 :
|
||||
search([elem], lt) != [[]];
|
Reference in New Issue
Block a user