diff --git a/lib/std/sort/binarysearch.c3 b/lib/std/sort/binarysearch.c3 index dd89125a9..046b023b2 100644 --- a/lib/std/sort/binarysearch.c3 +++ b/lib/std/sort/binarysearch.c3 @@ -34,14 +34,15 @@ macro usz binarysearch_with(list, x, cmp) * @require is_searchable(list) "The list must be indexable and support .len or .len()" * @checked less(list[0], x) "The values must be comparable" **/ -macro usz binarysearch(list, x) +macro usz binarysearch(list, x) @builtin { usz i; usz len = @len_from_list(list); for (usz j = len; i < j;) { usz half = (i + j) / 2; - switch { + switch + { case greater(list[half], x): j = half; case less(list[half], x): i = half + 1; default: return half; diff --git a/lib/std/sort/quicksort.c3 b/lib/std/sort/quicksort.c3 index 4a1beff64..b346fa839 100644 --- a/lib/std/sort/quicksort.c3 +++ b/lib/std/sort/quicksort.c3 @@ -1,7 +1,7 @@ module std::sort; import std::sort::qs; -macro quicksort(list, cmp = null) +macro quicksort(list, cmp = null) @builtin { var $Type = $typeof(list); var $CmpType = $typeof(cmp);