aboutsummaryrefslogtreecommitdiff
path: root/core/sort
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-10-16 14:55:36 +0100
committergingerBill <bill@gingerbill.org>2020-10-16 14:55:36 +0100
commit41f6a684e188a2f5af6fe4558590f82b9ba5c700 (patch)
tree8dc13f5fe3805dcdc39ad169d2997634a16de7bc /core/sort
parent289908e0b8a42dfe215555245d2291c2aaa41f4f (diff)
Rename `slice.sort_proc` to `slice.sort_by`; add `slice.sort_by_key`
Diffstat (limited to 'core/sort')
-rw-r--r--core/sort/sort.odin8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/sort/sort.odin b/core/sort/sort.odin
index 7927bfa11..23a6ef8b3 100644
--- a/core/sort/sort.odin
+++ b/core/sort/sort.odin
@@ -290,7 +290,7 @@ _insertion_sort :: proc(it: Interface, a, b: int) {
-// @(deprecated="use sort.sort or slice.sort_proc")
+// @(deprecated="use sort.sort or slice.sort_by")
bubble_sort_proc :: proc(array: $A/[]$T, f: proc(T, T) -> int) {
assert(f != nil);
count := len(array);
@@ -347,7 +347,7 @@ bubble_sort :: proc(array: $A/[]$T) where intrinsics.type_is_ordered(T) {
}
}
-// @(deprecated="use sort.sort or slice.sort_proc")
+// @(deprecated="use sort.sort or slice.sort_by")
quick_sort_proc :: proc(array: $A/[]$T, f: proc(T, T) -> int) {
assert(f != nil);
a := array;
@@ -412,7 +412,7 @@ _log2 :: proc(x: int) -> int {
return res;
}
-// @(deprecated="use sort.sort or slice.sort_proc")
+// @(deprecated="use sort.sort or slice.sort_by")
merge_sort_proc :: proc(array: $A/[]$T, f: proc(T, T) -> int) {
merge :: proc(a: A, start, mid, end: int, f: proc(T, T) -> int) {
s, m := start, mid;
@@ -497,7 +497,7 @@ merge_sort :: proc(array: $A/[]$T) where intrinsics.type_is_ordered(T) {
}
-// @(deprecated="use sort.sort or slice.sort_proc")
+// @(deprecated="use sort.sort or slice.sort_by")
heap_sort_proc :: proc(array: $A/[]$T, f: proc(T, T) -> int) {
sift_proc :: proc(a: A, pi: int, n: int, f: proc(T, T) -> int) #no_bounds_check {
p := pi;