git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, derrickstolee@github.com, gregory.szorc@gmail.com
Subject: [PATCH 6/7] midx.c: remove unnecessary loop condition
Date: Mon, 19 Sep 2022 21:55:53 -0400	[thread overview]
Message-ID: <4c9c18de2d3a36c0939d21027b73762b20298477.1663638929.git.me@ttaylorr.com> (raw)
In-Reply-To: <cover.1663638929.git.me@ttaylorr.com>

The fill_included_packs_batch() routine is responsible for aggregating
objects in packs with a non-zero value for the `--batch-size` option of
the `git multi-pack-index repack` sub-command.

Since this routine is explicitly called only when `--batch-size` is
non-zero, there is no point in checking that this is the case in our
loop condition.

Remove the unnecessary part of this condition to avoid confusion.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
 midx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/midx.c b/midx.c
index d703fc5a16..273704caed 100644
--- a/midx.c
+++ b/midx.c
@@ -1928,7 +1928,7 @@ static int fill_included_packs_batch(struct repository *r,
 		pack_info[i].mtime = m->packs[i]->mtime;
 	}
 
-	for (i = 0; batch_size && i < m->num_objects; i++) {
+	for (i = 0; i < m->num_objects; i++) {
 		uint32_t pack_int_id = nth_midxed_pack_int_id(m, i);
 		pack_info[pack_int_id].referenced_objects++;
 	}
-- 
2.37.0.1.g1379af2e9d


  parent reply	other threads:[~2022-09-20  1:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20  1:55 [PATCH 0/7] midx: ignore cruft pack with `repack`, `expire` Taylor Blau
2022-09-20  1:55 ` [PATCH 1/7] Documentation/git-multi-pack-index.txt: fix typo Taylor Blau
2022-09-20  1:55 ` [PATCH 2/7] Documentation/git-multi-pack-index.txt: clarify expire behavior Taylor Blau
2022-09-20  1:55 ` [PATCH 3/7] midx.c: prevent `expire` from removing the cruft pack Taylor Blau
2022-09-22 14:08   ` Derrick Stolee
2022-09-20  1:55 ` [PATCH 4/7] midx.c: avoid cruft packs with `repack --batch-size=0` Taylor Blau
2022-09-20  1:55 ` [PATCH 5/7] midx.c: replace `xcalloc()` with `CALLOC_ARRAY()` Taylor Blau
2022-09-20  1:55 ` Taylor Blau [this message]
2022-09-20  1:55 ` [PATCH 7/7] midx.c: avoid cruft packs with non-zero `repack --batch-size` Taylor Blau
2022-09-20 14:39 ` [PATCH 0/7] midx: ignore cruft pack with `repack`, `expire` Christian Couder
2022-09-22 14:14 ` Derrick Stolee

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=4c9c18de2d3a36c0939d21027b73762b20298477.1663638929.git.me@ttaylorr.com \
    --to=me@ttaylorr.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=gregory.szorc@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).