From: Brendan Hansen Date: Thu, 23 Mar 2023 23:35:33 +0000 (-0500) Subject: bugfix: `map.as_iter` had wrong typeof X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=99ddbf6d675b2b9cfc9ea7640e99c4507c5deade;p=onyx.git bugfix: `map.as_iter` had wrong typeof --- 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; });