mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-13 13:53:43 +00:00
Merge pull request #6771 from TheRadischen/patch-2
rotate crashes with 0 length
This commit is contained in:
@@ -433,6 +433,9 @@ fill :: proc "contextless" (array: $T/[]$E, value: E) #no_bounds_check {
|
||||
}
|
||||
|
||||
rotate_left :: proc "contextless" (array: $T/[]$E, mid: int) {
|
||||
if len(a) == 0 {
|
||||
return
|
||||
}
|
||||
n := len(array)
|
||||
m := mid %% n
|
||||
k := n - m
|
||||
|
||||
Reference in New Issue
Block a user