Merge pull request #7363 from PavLL/fix-wrong-bounds-check-directive

core/slice/slice.odin: fix slice.get doing unnecessary bounds check
This commit is contained in:
Jeroen van Rijn
2026-08-17 19:04:01 +02:00
committed by GitHub

View File

@@ -563,7 +563,7 @@ last_ptr :: proc(array: $T/[]$E) -> ^E {
@(require_results)
get :: proc "contextless" (array: $T/[]$E, index: int) -> (value: E, ok: bool) {
#bounds_check if uint(index) < len(array) {
#no_bounds_check if uint(index) < len(array) {
value = array[index]
ok = true
}