From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>,
git@vger.kernel.org
Subject: Re: ac/bitmap-lookup-table, was Re: What's cooking in git.git (Aug 2022, #09; Fri, 26)
Date: Mon, 29 Aug 2022 00:36:23 -0700 [thread overview]
Message-ID: <xmqqh71vqz60.fsf@gitster.g> (raw)
In-Reply-To: YwtkqmPSEikWPLv5@coredump.intra.peff.net
Jeff King <peff@peff.net> writes:
> We may want this on top:
Obviously correct. Thanks. Will queue.
>
> -- >8 --
> Subject: pack-bitmap-write: drop unused pack_idx_entry parameters
>
> Our write_selected_commits_v1() function takes an array of
> pack_idx_entry structs. We used to need them for computing commit
> positions, but since aa30162559 (bitmap: move `get commit positions`
> code to `bitmap_writer_finish`, 2022-08-14), the caller passes in a
> separate array of positions for us. We can drop the unused array (and
> its matching length parameter).
>
> Likewise, when we added write_lookup_table() in 93eb41e240
> (pack-bitmap-write.c: write lookup table extension, 2022-08-14), it
> receives the same array of positions. So its "index" parameter was never
> used at all.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> pack-bitmap-write.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
> index 2cfc92f287..a213f5eddc 100644
> --- a/pack-bitmap-write.c
> +++ b/pack-bitmap-write.c
> @@ -649,8 +649,6 @@ static const struct object_id *oid_access(size_t pos, const void *table)
> }
>
> static void write_selected_commits_v1(struct hashfile *f,
> - struct pack_idx_entry **index,
> - uint32_t index_nr,
> uint32_t *commit_positions,
> off_t *offsets)
> {
> @@ -685,8 +683,6 @@ static int table_cmp(const void *_va, const void *_vb, void *_data)
> }
>
> static void write_lookup_table(struct hashfile *f,
> - struct pack_idx_entry **index,
> - uint32_t index_nr,
> uint32_t *commit_positions,
> off_t *offsets)
> {
> @@ -808,10 +804,10 @@ void bitmap_writer_finish(struct pack_idx_entry **index,
> commit_positions[i] = commit_pos;
> }
>
> - write_selected_commits_v1(f, index, index_nr, commit_positions, offsets);
> + write_selected_commits_v1(f, commit_positions, offsets);
>
> if (options & BITMAP_OPT_LOOKUP_TABLE)
> - write_lookup_table(f, index, index_nr, commit_positions, offsets);
> + write_lookup_table(f, commit_positions, offsets);
>
> if (options & BITMAP_OPT_HASH_CACHE)
> write_hash_cache(f, index, index_nr);
prev parent reply other threads:[~2022-08-29 7:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 21:20 What's cooking in git.git (Aug 2022, #09; Fri, 26) Junio C Hamano
2022-08-26 21:34 ` Philip Oakley
2022-08-26 22:32 ` Junio C Hamano
2022-08-29 11:24 ` Johannes Schindelin
2022-08-28 12:50 ` ac/bitmap-lookup-table, was " Jeff King
2022-08-29 7:36 ` Junio C Hamano [this message]
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=xmqqh71vqz60.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=chakrabortyabhradeep79@gmail.com \
--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).