mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge branch 'odin-lang:master' into raylib5
This commit is contained in:
@@ -170,9 +170,7 @@ binary_search :: proc(array: $A/[]$T, key: T) -> (index: int, found: bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
@(require_results)
|
@(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 {
|
||||||
where intrinsics.type_is_ordered(T) #no_bounds_check
|
|
||||||
{
|
|
||||||
// INVARIANTS:
|
// INVARIANTS:
|
||||||
// - 0 <= left <= (left + size = right) <= len(array)
|
// - 0 <= left <= (left + size = right) <= len(array)
|
||||||
// - f returns .Less for everything in array[:left]
|
// - f returns .Less for everything in array[:left]
|
||||||
|
|||||||
Reference in New Issue
Block a user