diff --git a/src/bot.zig b/src/bot.zig index 658e6b6..db2474d 100644 --- a/src/bot.zig +++ b/src/bot.zig @@ -171,12 +171,9 @@ pub const Bot = struct { } self.sent_messages.deinit(self.allocator); - var idx = self.previous_idx(self.top); - while (idx != self.bottom) : (idx = self.previous_idx(idx)) { - if (self.backlog[idx]) |message| { + for (self.backlog) |slot| { + if (slot) |message| { message.deinit(self.allocator); - } else { - break; } } }