From 9d4766c403ad107c2e2e1306b772f83b7a527054 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Wed, 23 Sep 2026 21:07:31 +0200 Subject: initialize lists as empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- src/main.zig | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.zig b/src/main.zig index 7cc6803..2730187 100644 --- a/src/main.zig +++ b/src/main.zig @@ -335,9 +335,9 @@ const Builder = struct { options: Options, // track files which affect build output (paths relative to root_dir) - parts: std.ArrayList([]const u8), + parts: std.ArrayList([]const u8) = .empty, // track component digests which should affect digest check - dgsts: std.ArrayList(Digest), + dgsts: std.ArrayList(Digest) = .empty, pub const Options = struct { // TODO: this is a bit of a hack no? @@ -356,16 +356,14 @@ const Builder = struct { .options = .{ .offset_from_siteroot = "/site", }, - .parts = .empty, - .dgsts = .empty, }; return b; } fn deinit(self: *Builder, gpa: Allocator) void { + self.dgsts.deinit(gpa); for (self.parts.items) |p| gpa.free(p); self.parts.deinit(gpa); - self.dgsts.deinit(gpa); gpa.destroy(self); } -- cgit 1.4.1