diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2021-01-23 19:58:12 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-23 17:14:07 -0800 |
commit | 8d87e338e16e022545638a0e9a3e15c6bdb56111 (patch) | |
tree | 3d02c87ba1f6d1f5f39965588f573cc3cc1ddc87 /Documentation/RelNotes/2.20.0.txt | |
parent | cache-tree: clean up cache_tree_update() (diff) | |
download | tgif-8d87e338e16e022545638a0e9a3e15c6bdb56111.tar.xz |
cache-tree: simplify verify_cache() prototype
The verify_cache() method takes an array of cache entries and a count,
but these are always provided directly from a struct index_state. Use
a pointer to the full structure instead.
There is a subtle point when istate->cache_nr is zero that subtracting
one will underflow. This triggers a failure in t0000-basic.sh, among
others. Use "i + 1 < istate->cache_nr" to avoid these strange
comparisons. Convert i to be unsigned as well, which also removes the
potential signed overflow in the unlikely case that cache_nr is over 2.1
billion entries. The 'funny' variable has a maximum value of 11, so
making it unsigned does not change anything of importance.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/RelNotes/2.20.0.txt')
0 files changed, 0 insertions, 0 deletions