git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/3] raw_object_store: drop extra pointer to replace_map
Date: Tue, 13 May 2025 11:48:44 +0200	[thread overview]
Message-ID: <aCMVfHbB7pJ6Mo4j@pks.im> (raw)
In-Reply-To: <20250512185233.GC1276214@coredump.intra.peff.net>

On Mon, May 12, 2025 at 02:52:33PM -0400, Jeff King wrote:
> 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

  reply	other threads:[~2025-05-13  9:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-12 18:50 [PATCH 0/3] minor oidmap cleanups Jeff King
2025-05-12 18:50 ` [PATCH 1/3] oidmap: rename oidmap_free() to oidmap_clear() Jeff King
2025-05-12 18:51 ` [PATCH 2/3] oidmap: add size function Jeff King
2025-05-13  9:48   ` Patrick Steinhardt
2025-05-14 17:59     ` Jeff King
2025-05-12 18:52 ` [PATCH 3/3] raw_object_store: drop extra pointer to replace_map Jeff King
2025-05-13  9:48   ` Patrick Steinhardt [this message]
2025-05-14 14:38     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aCMVfHbB7pJ6Mo4j@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).