fix slice.get doing unnecessary bounds check

This commit is contained in:
pav
2026-08-17 18:40:12 +02:00
parent 645b57be9f
commit 2c7b3e6780

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
}