╭ changed ───────────╮ │src/ui/Repo/Refs.zig│ ╰────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │74 var repo = rp.Repo(.xit, .{}).open(io, gpa, .{ .path = repo_path }) catch return empty; │ │75 defer repo.deinit(io, gpa); │ │76 │ │77 - var branch_iter = repo.listBranches(io, gpa) catch return empty; │ │77 + var branch_iter = repo.listBranches(io, gpa, .{ .index = branches_after }) catch return empty;│ │78 defer branch_iter.deinit(io); │ │79 const branches = try collectWindow(io, aa, &branch_iter, branches_after); │ │80 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────╮ │81 - var tag_iter = repo.listTags(io, gpa) catch return empty; │ │81 + var tag_iter = repo.listTags(io, gpa, .{ .index = tags_after }) catch return empty;│ │82 defer tag_iter.deinit(io); │ │83 const tags = try collectWindow(io, aa, &tag_iter, tags_after); │ │84 │ ╰───────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │ 95 }; │ │ 96 } │ │ 97 │ │ 98 -// window a ref iterator without materializing the whole list: skip the prior │ │ 99 -// windows, take this window's names into the page arena (`aa`), then peek one │ │100 -// more to learn whether a "next →" window exists. │ │ 98 +// window a ref iterator without materializing the whole list │ │ 99 fn collectWindow(io: std.Io, aa: std.mem.Allocator, iter: anytype, after: usize) !Window {│ │102 - var skipped: usize = 0; │ │103 - while (skipped < after) : (skipped += 1) { │ │104 - if (try iter.next(io) == null) return .{ .names = &.{}, .next_after = null }; │ │105 - } │ │100 var names = try std.ArrayListUnmanaged([]const u8).initCapacity(aa, page_size); │ │101 while (names.items.len < page_size) { │ │102 const ref = try iter.next(io) orelse break; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯