Skip to content

Commit 3919d40

Browse files
committed
Merge branch 'bd/maint-unpack-trees-parawalk-fix'
* bd/maint-unpack-trees-parawalk-fix: unpack-trees: Make index lookahead less pessimal
2 parents 8c7da86 + e53e6b4 commit 3919d40

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

unpack-trees.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,17 @@ static int find_cache_pos(struct traverse_info *info,
522522
const char *ce_name, *ce_slash;
523523
int cmp, ce_len;
524524

525-
if (!ce_in_traverse_path(ce, info))
525+
if (ce->ce_flags & CE_UNPACKED) {
526+
/*
527+
* cache_bottom entry is already unpacked, so
528+
* we can never match it; don't check it
529+
* again.
530+
*/
531+
if (pos == o->cache_bottom)
532+
++o->cache_bottom;
526533
continue;
527-
if (ce->ce_flags & CE_UNPACKED)
534+
}
535+
if (!ce_in_traverse_path(ce, info))
528536
continue;
529537
ce_name = ce->name + pfxlen;
530538
ce_slash = strchr(ce_name, '/');

0 commit comments

Comments
 (0)