Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/pack.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-03-30 18:04:36 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-01 23:07:37 +0300
commit30077524611cae8f25111e2c8b8d42136aa58787 (patch)
tree3f2baaf6817d22018f5d999dd3e70f37d2de57a2 /pack.h
parent38ff7cabb6b8e51df78ce20c20632eba24265ee4 (diff)
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 'pack.h')
0 files changed, 0 insertions, 0 deletions