raw_object_store: drop extra pointer to replace_map

We store the replacement data in an oidmap, which is itself a pointer in
the raw_object_store struct. But there's no need for an extra pointer
indirection here. It is always allocated and initialized along with the
containing struct, and we never check it for NULL-ness.

Let's embed the map directly in the struct, which is simpler and avoids
extra pointer chasing.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2025-05-12 14:52:33 -04:00
committed by Junio C Hamano
parent 596184786c
commit 4b63963f5d
5 changed files with 8 additions and 10 deletions

View File

@@ -222,7 +222,7 @@ static int commit_graph_compatible(struct repository *r)
if (replace_refs_enabled(r)) {
prepare_replace_object(r);
if (oidmap_get_size(r->objects->replace_map))
if (oidmap_get_size(&r->objects->replace_map))
return 0;
}