From 1b12f7aadaf0e0a4570a5985900f61d0fb897f79 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 00:22:27 -0300 Subject: surface: a frame's images are a std.ArrayList(ImagePlace), where they were a slice of optionals grown by hand (appendImagePlace's doubling realloc, nimages beside it) whose slots were never null: every reader's `orelse continue` and `.?` go (gui, tui, terminal, TerminalImages, ninep/screen, test/pdf.zig, kitty and the two PDF benches); macos.zig's loop the same, passing ast-check but not built here Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/pdf_scroll_bench.zig | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'test/pdf_scroll_bench.zig') diff --git a/test/pdf_scroll_bench.zig b/test/pdf_scroll_bench.zig index f3d47b1e..391a98e6 100644 --- a/test/pdf_scroll_bench.zig +++ b/test/pdf_scroll_bench.zig @@ -460,14 +460,10 @@ const Recorder = struct { /// which pixels arrive. fn observe(self: *Recorder, frame: usize, surface: *const pardes.Surface) void { self.frames += 1; - self.visual = mix(self.visual, surface.nimages); - self.transport = mix(self.transport, surface.nimages); + self.visual = mix(self.visual, surface.images.items.len); + self.transport = mix(self.transport, surface.images.items.len); const full = frame % full_rgba_stride == 0; - for (surface.images[0..surface.nimages]) |maybe| { - const place = maybe orelse { - self.visual = mix(self.visual, std.math.maxInt(u64)); - continue; - }; + for (surface.images.items) |place| { self.images += 1; self.visual = mix(self.visual, place.pane); self.visual = mix(self.visual, place.x); -- cgit v1.3