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 {...@@ -1214,7 +1214,6 @@ pub const Repository = struct {
1214 const tree = try r.getTreeA(arena, tree_id.id);1214 const tree = try r.getTreeA(arena, tree_id.id);
1215 for (result.keys(), 0..) |k, i| {1215 for (result.keys(), 0..) |k, i| {
1216 if (set.isSet(i)) continue;1216 if (set.isSet(i)) continue;
1217 const original = base_tree.get(k).?;
1218 const new = tree.get(k);1217 const new = tree.get(k);
1219 if (new == null) {1218 if (new == null) {
1220 found += 1;1219 found += 1;
...@@ -1223,7 +1222,7 @@ pub const Repository = struct {...@@ -1223,7 +1222,7 @@ pub const Repository = struct {
1223 // std.log.debug("found [{d}/{d}] objects after searching {d} commits", .{ found, total, searched });1222 // std.log.debug("found [{d}/{d}] objects after searching {d} commits", .{ found, total, searched });
1224 continue;1223 continue;
1225 }1224 }
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())) {
1227 found += 1;1226 found += 1;
1228 result.putAssumeCapacity(k, commit_id_prev);1227 result.putAssumeCapacity(k, commit_id_prev);
1229 set.set(i);1228 set.set(i);