]> git.ipfire.org Git - thirdparty/git.git/commit
midx: drop unused parameters from add_midx_to_chain()
authorJeff King <peff@peff.net>
Tue, 13 Aug 2024 05:02:16 +0000 (01:02 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Aug 2024 17:36:34 +0000 (10:36 -0700)
commit1784522a1f3d35195c2c28137ed49f36caa5022e
treeee40c633ff9844a4f711a4fcfd72dded32ffffcf
parentfcb2205b77470c60f996a3206b2d4aebf6e951e3
midx: drop unused parameters from add_midx_to_chain()

When loading a chained midx, we build up an array of hashes, one per
layer of the chain. But since the chain is also represented by the
linked list of multi_pack_index structs, nobody actually reads this
array. We pass it to add_midx_to_chain(), but the parameters are
completely ignored.

So we can drop those unused parameters. And then we can see that its
sole caller, load_midx_chain_fd_st(), only cares about one layer hash at a
time (for parsing each line and feeding it to the single-layer midx
code). So we can replace the array with a single object_id on the stack.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx.c