diff options
author | Kjetil Barvik <barvik@broadpark.no> | 2009-02-09 21:54:04 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-09 20:59:26 -0800 |
commit | 60b458b7d31ff2497ed90cbe9f65444d84882cec (patch) | |
tree | 921b6a269a66bfa6b03ea3c861ca19c18cf14ce6 /Documentation/CodingGuidelines | |
parent | f6b98e46bdf64454d7c6ab76d617237118799d7b (diff) | |
download | git-60b458b7d31ff2497ed90cbe9f65444d84882cec.tar.gz git-60b458b7d31ff2497ed90cbe9f65444d84882cec.tar.xz |
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 'Documentation/CodingGuidelines')
0 files changed, 0 insertions, 0 deletions