[PATCH v3 2/2] pack-bitmap.c: remove unnecessary "open_pack_index()" calls
- From
Teng Long <dyroneteng@gmail.com>
- Date
- Nov 4, 2022, 03:17 UTC
- Message-ID
- <7ac9b859f31b2b3efb4a04896892ccd094a98734.1667470481.git.dyroneteng@gmail.com>
- In-Reply-To
- <cover.1667470481.git.dyroneteng@gmail.com>
From: Teng Long <dyroneteng@gmail.com>
Everytime when calling "open_pack_bitmap_1()", we will firstly call "open_pack_index(packfile)" to check the index, then further check again in "is_pack_valid()" before mmap the bitmap file. So, let's remove the first check here.
The relate discussion: https://public-inbox.org/git/Y2IiSU1L+bJPUioV@coredump.intra.peff.net/#t
Signed-off-by: Teng Long <dyroneteng@gmail.com> --- pack-bitmap.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/pack-bitmap.c b/pack-bitmap.c index 9443b7adca..503c95f0b8 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -412,9 +412,6 @@ static int open_pack_bitmap_1(struct bitmap_index *bitmap_git, struct packed_git struct stat st; char *bitmap_name; - if (open_pack_index(packfile)) - return -1; - bitmap_name = pack_bitmap_filename(packfile); fd = git_open(bitmap_name);
-- 2.38.1.383.g35840fde1dd