diff options
| author | Phil <homan.phil@gmail.com> | 2022-09-07 10:53:56 -0700 |
|---|---|---|
| committer | Phil <homan.phil@gmail.com> | 2022-09-07 10:53:56 -0700 |
| commit | 7d55bfc120ff688a2fc44624eff9e07456a8e830 (patch) | |
| tree | 2d9dfbc7bb45397ecbb2b4570651ba9a9b47da1a | |
| parent | 70b0ade8c3ef6917a40793025e2aab97d3d25578 (diff) | |
fix sort_by_indices_allocate
| -rw-r--r-- | core/slice/sort.odin | 2 |
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] } |