diff options
author | Jeff King <peff@peff.net> | 2021-03-30 11:04:36 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-01 13:07:37 -0700 |
commit | 30077524611cae8f25111e2c8b8d42136aa58787 (patch) | |
tree | 3f2baaf6817d22018f5d999dd3e70f37d2de57a2 /Documentation/glossary-content.txt | |
parent | pack-revindex: write multi-pack reverse indexes (diff) | |
download | tgif-30077524611cae8f25111e2c8b8d42136aa58787.tar.xz |
midx.c: improve cache locality in midx_pack_order_cmp()
There is a lot of pointer dereferencing in the pre-image version of
'midx_pack_order_cmp()', which this patch gets rid of.
Instead of comparing the pack preferred-ness and then the pack id, both
of these checks are done at the same time by using the high-order bit of
the pack id to represent whether it's preferred. Then the pack id and
offset are compared as usual.
This produces the same result so long as there are less than 2^31 packs,
which seems like a likely assumption to make in practice.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/glossary-content.txt')
0 files changed, 0 insertions, 0 deletions