aboutsummaryrefslogtreecommitdiff
path: root/core/slice
diff options
context:
space:
mode:
authorMatija Dizdar <matija.dizdar@protonmail.com>2023-12-06 21:48:37 +0100
committerMatija Dizdar <matija.dizdar@protonmail.com>2023-12-06 21:48:37 +0100
commit843b2350eb11d61084c7af40f347b47eed8f98f0 (patch)
treec742392bb81753f3c089a252ad0ce21596752279 /core/slice
parent526d33830029ec87b5087a49a095b554bfad9bf0 (diff)
added #no_bounds_check back into binary_search_by
Diffstat (limited to 'core/slice')
-rw-r--r--core/slice/slice.odin3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/slice/slice.odin b/core/slice/slice.odin
index 67e86bf4c..748bd28f7 100644
--- a/core/slice/slice.odin
+++ b/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]