aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2022-09-07 19:58:42 +0200
committerGitHub <noreply@github.com>2022-09-07 19:58:42 +0200
commit37e23a19b516befeb8e4f6df5b506ac93dbe81bf (patch)
treeeded8f2cad39f28aa20751e08f0eea1b322212be
parentab1741ab38d6eae8a6f0927119a1d3223c1928cc (diff)
parent7d55bfc120ff688a2fc44624eff9e07456a8e830 (diff)
Merge pull request #2033 from thePHTest/poly-proc
fix sort_by_indices_allocate
-rw-r--r--core/slice/sort.odin2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/slice/sort.odin b/core/slice/sort.odin
index 365bbce96..8177205ed 100644
--- a/core/slice/sort.odin
+++ b/core/slice/sort.odin
@@ -43,7 +43,7 @@ sort_by_indices :: proc{ sort_by_indices_allocate, _sort_by_indices}
sort_by_indices_allocate :: proc(data: $T/[]$E, indices: []int, allocator := context.allocator) -> (sorted: T) {
assert(len(data) == len(indices))
- sorted = make([]int, len(data), allocator)
+ sorted = make(T, len(data), allocator)
for v, i in indices {
sorted[i] = data[v]
}