summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorKjetil Barvik <barvik@broadpark.no>2009-02-09 20:54:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-02-10 04:59:26 (GMT)
commit60b458b7d31ff2497ed90cbe9f65444d84882cec (patch)
tree921b6a269a66bfa6b03ea3c861ca19c18cf14ce6 /log-tree.c
parentf6b98e46bdf64454d7c6ab76d617237118799d7b (diff)
downloadgit-60b458b7d31ff2497ed90cbe9f65444d84882cec.zip
git-60b458b7d31ff2497ed90cbe9f65444d84882cec.tar.gz
git-60b458b7d31ff2497ed90cbe9f65444d84882cec.tar.bz2
lstat_cache(): small cleanup and optimisation
Simplify the if-else test in longest_match_lstat_cache() such that we only have one simple if test. Instead of testing for 'i == cache.len' or 'i == len', we transform this to a common test for 'i == max_len'. And to further optimise we use 'i >= max_len' instead of 'i == max_len', the reason is that it is now the exact opposite of one part inside the while-loop termination expression 'i < max_len && name[i] == cache.path[i]', and then the compiler can probably reuse a test instruction from it. We also throw away the arguments to reset_lstat_cache(), such that all the safeguard logic inside lstat_cache() is handled at one place. Signed-off-by: Kjetil Barvik <barvik@broadpark.no> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'log-tree.c')
0 files changed, 0 insertions, 0 deletions