mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Minor rename of a procedure
This commit is contained in:
@@ -81,14 +81,12 @@ sort_by_indices_overwrite :: proc(data: $T/[]$E, indices: []int) {
|
|||||||
swap_with_slice(data, temp)
|
swap_with_slice(data, temp)
|
||||||
}
|
}
|
||||||
|
|
||||||
@(private)
|
sort_from_permutation_indices :: proc(data: $T/[]$E, indices: []int) {
|
||||||
_internal_sort_from_indices_permuation :: proc(data: $T/[]$E, indices: []int) {
|
|
||||||
assert(len(data) == len(indices))
|
assert(len(data) == len(indices))
|
||||||
if len(indices) <= 1 {
|
if len(indices) <= 1 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(bill): This is not O(N)
|
|
||||||
for i in 0..<len(indices) {
|
for i in 0..<len(indices) {
|
||||||
index_to_swap := indices[i]
|
index_to_swap := indices[i]
|
||||||
|
|
||||||
@@ -124,7 +122,7 @@ sort_with_indices :: proc(data: $T/[]$E, allocator := context.allocator) -> (ind
|
|||||||
return .Equal
|
return .Equal
|
||||||
}, raw_data(data))
|
}, raw_data(data))
|
||||||
|
|
||||||
_internal_sort_from_indices_permuation(data, indices)
|
sort_from_permutation_indices(data, indices)
|
||||||
}
|
}
|
||||||
return indices
|
return indices
|
||||||
}
|
}
|
||||||
@@ -201,7 +199,7 @@ sort_by_with_indices :: proc(data: $T/[]$E, less: proc(i, j: E) -> bool, allocat
|
|||||||
return .Equal
|
return .Equal
|
||||||
}, ctx)
|
}, ctx)
|
||||||
|
|
||||||
_internal_sort_from_indices_permuation(data, indices)
|
sort_from_permutation_indices(data, indices)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return indices
|
return indices
|
||||||
@@ -234,7 +232,7 @@ sort_by_with_indices_with_data :: proc(data: $T/[]$E, less: proc(i, j: E, user_d
|
|||||||
return .Equal
|
return .Equal
|
||||||
}, ctx)
|
}, ctx)
|
||||||
|
|
||||||
_internal_sort_from_indices_permuation(data, indices)
|
sort_from_permutation_indices(data, indices)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return indices
|
return indices
|
||||||
|
|||||||
Reference in New Issue
Block a user