From 4b63963f5d729cb9eb997c8912b7d500ffc53297 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 12 May 2025 14:52:33 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- object-store.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'object-store.h') diff --git a/object-store.h b/object-store.h index 46961dc954..9f6f27c016 100644 --- a/object-store.h +++ b/object-store.h @@ -5,6 +5,7 @@ #include "object.h" #include "list.h" #include "oidset.h" +#include "oidmap.h" #include "thread-utils.h" struct oidmap; @@ -176,7 +177,7 @@ struct raw_object_store { * Objects that should be substituted by other objects * (see git-replace(1)). */ - struct oidmap *replace_map; + struct oidmap replace_map; unsigned replace_map_initialized : 1; pthread_mutex_t replace_mutex; /* protect object replace functions */ -- cgit v1.3-6-g1900