mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-24 14:01:37 +00:00
fix slice.get doing unnecessary bounds check
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user