mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix slice.reverse
This commit is contained in:
@@ -77,8 +77,7 @@ swap_between :: proc(a, b: $T/[]$E) {
|
|||||||
reverse :: proc(array: $T/[]$E) {
|
reverse :: proc(array: $T/[]$E) {
|
||||||
n := len(array)/2
|
n := len(array)/2
|
||||||
for i in 0..<n {
|
for i in 0..<n {
|
||||||
a, b := i, len(array)-i-1
|
swap(array, i, len(array)-i-1)
|
||||||
array[a], array[b] = array[b], array[a]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user