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 <kevin@bracey.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Kevin Bracey committed May 16, 2013 at 18:32 UTC 83f0412f3fff3b4108e7f05c30f3e861d148f5f2
1 file changed +1 -1
decorate.c
+1 -1
@@ -49,7 +49,7 @@ static void grow_decoration(struct decoration *n)
49 const struct object *base = old_hash[i].base;
50 void *decoration = old_hash[i].decoration;
51
52 - if (!base)
52 + if (!decoration)
53 continue;
54 insert_decoration(n, base, decoration);
55 }