Re: [PATCH 3/3] raw_object_store: drop extra pointer to replace_map
- From
Patrick Steinhardt <ps@pks.im>
- Date
- May 13, 2025, 09:48 UTC
- Message-ID
- <aCMVfHbB7pJ6Mo4j@pks.im>
- In-Reply-To
- <20250512185233.GC1276214@coredump.intra.peff.net>
On Mon, May 12, 2025 at 02:52:33PM -0400, Jeff King wrote:
Show 12 quoted lines
> 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> > --- > This one may be more subjective, but IMHO it's good to avoid extra > pointers when we can.
Yup, I agree it is a sensible step. There is no good reason why the map should be allocated, so let's just not.
All of these cleanups in this series look good to me. Thanks!
Patrick