Fix slice.reverse
This commit is contained in:
1 parent
450a602230
commit
db8b2e69dd
1 file changed
+1
-2
@@ -77,8 +77,7 @@ swap_between :: proc(a, b: $T/[]$E) {
|
||||
reverse :: proc(array: $T/[]$E) {
|
||||
n := len(array)/2
|
||||
for i in 0..<n {
|
||||
a, b := i, len(array)-i-1
|
||||
array[a], array[b] = array[b], array[a]
|
||||
swap(array, i, len(array)-i-1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user