Browse Source

added #no_bounds_check back into binary_search_by

Matija Dizdar 1 year ago
parent
commit
843b2350eb
1 changed files with 1 additions and 2 deletions
  1. 1 2
      core/slice/slice.odin

+ 1 - 2
core/slice/slice.odin

@@ -170,8 +170,7 @@ binary_search :: proc(array: $A/[]$T, key: T) -> (index: int, found: bool)
 }
 
 @(require_results)
-binary_search_by :: proc(array: $A/[]$T, key: T, f: proc(T, T) -> Ordering) -> (index: int, found: bool)
-{
+binary_search_by :: proc(array: $A/[]$T, key: T, f: proc(T, T) -> Ordering) -> (index: int, found: bool) #no_bounds_check {
 	// INVARIANTS:
 	// - 0 <= left <= (left + size = right) <= len(array)
 	// - f returns .Less    for everything in array[:left]