From d1c823df41e5597ec81d55c3a8d589b3d46dc9fc Mon Sep 17 00:00:00 2001 From: kayomn Date: Sun, 1 Sep 2024 22:37:36 +0100 Subject: [PATCH] Fix comptime checks in slot map --- src/ona/ona.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ona/ona.zig b/src/ona/ona.zig index 4aeb1ee..ee65e67 100644 --- a/src/ona/ona.zig +++ b/src/ona/ona.zig @@ -641,7 +641,12 @@ pub fn SlotMap(comptime Value: type) type { .signedness = .unsigned, }}); - comptime std.debug.assert(@sizeOf(Index) == @sizeOf(usize)); + const Slot = packed struct { + index: Index, + is_occupied: bool, + }; + + comptime std.debug.assert(@sizeOf(Slot) == @sizeOf(usize)); return struct { slots: stack.Sequential(Slot), @@ -655,11 +660,6 @@ pub fn SlotMap(comptime Value: type) type { const Self = @This(); - const Slot = packed struct { - index: Index, - is_occupied: bool, - }; - pub fn deinit(self: *Self) void { self.slots.deinit(); self.entries.deinit();