1
0
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:
Justin Lin
2020-03-13 09:43:15 +08:00
parent e6c4ffc117
commit 8f7149a550

View File

@@ -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) != [[]];