mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-29 16:31:32 +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)
|
@(require_results)
|
||||||
get :: proc "contextless" (array: $T/[]$E, index: int) -> (value: E, ok: bool) {
|
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]
|
value = array[index]
|
||||||
ok = true
|
ok = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user