summaryrefslogtreecommitdiff
path: root/midx.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2020-11-12 12:22:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-12 17:40:08 (GMT)
commitef1b853c15d443b057e5a6306c89b869168a8270 (patch)
tree57448ffa4afd1d6648c4a7954b8c2842e0a897a4 /midx.c
parent54273d1042b7a7e9a5635ccf15363eec819cb951 (diff)
downloadgit-ef1b853c15d443b057e5a6306c89b869168a8270.zip
git-ef1b853c15d443b057e5a6306c89b869168a8270.tar.gz
git-ef1b853c15d443b057e5a6306c89b869168a8270.tar.bz2
midx: use hashwrite_be64()
Call hashwrite_be64() to write 64-bit values instead of open-coding it using hashwrite_be32() and sizeof. This shortens the code and makes its intent clearer. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'midx.c')
-rw-r--r--midx.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/midx.c b/midx.c
index 0de42ff..f56321dc 100644
--- a/midx.c
+++ b/midx.c
@@ -790,9 +790,7 @@ static size_t write_midx_large_offsets(struct hashfile *f, uint32_t nr_large_off
if (!(offset >> 31))
continue;
- hashwrite_be32(f, offset >> 32);
- hashwrite_be32(f, offset & 0xffffffffUL);
- written += 2 * sizeof(uint32_t);
+ written += hashwrite_be64(f, offset);
nr_large_offset--;
}
@@ -980,8 +978,7 @@ static int write_midx_internal(const char *object_dir, struct multi_pack_index *
chunk_offsets[i]);
hashwrite_be32(f, chunk_ids[i]);
- hashwrite_be32(f, chunk_offsets[i] >> 32);
- hashwrite_be32(f, chunk_offsets[i]);
+ hashwrite_be64(f, chunk_offsets[i]);
written += MIDX_CHUNKLOOKUP_WIDTH;
}