authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-27 17:47:21 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-27 17:47:21 -07:00
log4d038861a1c4daebdf7a2287222912e2c621881b
tree38e62cf7b95d93f1e99187c3927baa57523390a3
parente7e3f078dcebdf6ae37eae5dad25f42a343ffba1
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

Repository.getTreeCommits: result is in the same order as base_tree.children so we can skip the .get lookup here

linux before and after debug: found 41 in 14208ms debug: found 41 in 9400ms

1 files changed, 1 insertions(+), 2 deletions(-)

git.zig+1-2
......@@ -1214,7 +1214,6 @@ pub const Repository = struct {
12141214 const tree = try r.getTreeA(arena, tree_id.id);
12151215 for (result.keys(), 0..) |k, i| {
12161216 if (set.isSet(i)) continue;
1217 const original = base_tree.get(k).?;
12181217 const new = tree.get(k);
12191218 if (new == null) {
12201219 found += 1;
......@@ -1223,7 +1222,7 @@ pub const Repository = struct {
12231222 // std.log.debug("found [{d}/{d}] objects after searching {d} commits", .{ found, total, searched });
12241223 continue;
12251224 }
1226 if (!std.mem.eql(u8, new.?.id.erase(), original.id.erase())) {
1225 if (!std.mem.eql(u8, new.?.id.erase(), base_tree.children.items.id[i].erase())) {
12271226 found += 1;
12281227 result.putAssumeCapacity(k, commit_id_prev);
12291228 set.set(i);