removed incorrect requirement for key type to be ordered in binary_search_by

This commit is contained in:
Matija Dizdar
2023-12-06 21:29:18 +01:00
parent 31b1aef44e
commit 526d338300

View File

@@ -171,7 +171,6 @@ 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)
where intrinsics.type_is_ordered(T) #no_bounds_check
{
// INVARIANTS:
// - 0 <= left <= (left + size = right) <= len(array)