From ae5ef0ce9c4745e8dec4f3876f4aa613565887d0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 24 Aug 2024 16:01:49 -0400 Subject: [PATCH] fix core:reflect/iterator.odin --- core/reflect/iterator.odin | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/reflect/iterator.odin b/core/reflect/iterator.odin index 5b84f0133..090fe04cc 100644 --- a/core/reflect/iterator.odin +++ b/core/reflect/iterator.odin @@ -19,6 +19,7 @@ iterate_array :: proc(val: any, it: ^int) -> (elem: any, index: int, ok: bool) { elem.data = rawptr(uintptr(val.data) + uintptr(it^ * info.elem_size)) elem.id = info.elem.id ok = true + index = it^ it^ += 1 } case Type_Info_Slice: @@ -27,6 +28,7 @@ iterate_array :: proc(val: any, it: ^int) -> (elem: any, index: int, ok: bool) { elem.data = rawptr(uintptr(array.data) + uintptr(it^ * info.elem_size)) elem.id = info.elem.id ok = true + index = it^ it^ += 1 } case Type_Info_Dynamic_Array: @@ -35,6 +37,7 @@ iterate_array :: proc(val: any, it: ^int) -> (elem: any, index: int, ok: bool) { elem.data = rawptr(uintptr(array.data) + uintptr(it^ * info.elem_size)) elem.id = info.elem.id ok = true + index = it^ it^ += 1 } } @@ -69,10 +72,12 @@ iterate_map :: proc(val: any, it: ^int) -> (key, value: any, ok: bool) { key.id = info.key.id value.id = info.value.id ok = true + it^ += 1 break } } } return -} \ No newline at end of file +} +