From 99ddbf6d675b2b9cfc9ea7640e99c4507c5deade Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Thu, 23 Mar 2023 18:35:33 -0500 Subject: [PATCH] bugfix: `map.as_iter` had wrong typeof --- core/container/map.onyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/container/map.onyx b/core/container/map.onyx index d0425540..5722b304 100644 --- a/core/container/map.onyx +++ b/core/container/map.onyx @@ -276,12 +276,12 @@ as_iter :: (m: &Map) => &.{ m = m, i = 0 }, ctx => { - if ctx.i >= ctx.m.entries.count { - return (typeof ctx.m.entries.data).{}, false; + if ctx.i < ctx.m.entries.count { + defer ctx.i += 1; + return &ctx.m.entries.data[ctx.i], true; } - defer ctx.i += 1; - return &ctx.m.entries.data[ctx.i], true; + return .{}, false; }); -- 2.25.1