Skip to content
This repository was archived by the owner on Jul 2, 2019. It is now read-only.

Commit 83f0412

Browse files
kjbracey2gitster
authored andcommitted
decorate.c: compact table when growing
When growing the table, take the opportunity to "compact" it by removing entries with NULL decoration. Users may have "removed" decorations by passing NULL to insert_decoration. An object's table entry can't actually be removed during normal operation, as it would break the linear hash collision search. But we can remove NULL decoration entries when rebuilding the table. Signed-off-by: Kevin Bracey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a765499 commit 83f0412

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

decorate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static void grow_decoration(struct decoration *n)
4949
const struct object *base = old_hash[i].base;
5050
void *decoration = old_hash[i].decoration;
5151

52-
if (!base)
52+
if (!decoration)
5353
continue;
5454
insert_decoration(n, base, decoration);
5555
}

0 commit comments

Comments
 (0)