Fixed type of temporary slice in sort_by_indices_overwrite

This commit is contained in:
Franz Höltermann
2024-01-08 17:11:06 +01:00
parent 7d3dfb1046
commit 873b7f8588

View File

@@ -62,7 +62,7 @@ _sort_by_indices :: proc(data, sorted: $T/[]$E, indices: []int) {
sort_by_indices_overwrite :: proc(data: $T/[]$E, indices: []int) {
assert(len(data) == len(indices))
temp := make([]int, len(data), context.allocator)
temp := make([]E, len(data), context.allocator)
defer delete(temp)
for v, i in indices {
temp[i] = data[v]