Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bracey <kevin@bracey.fi>2013-05-16 19:32:27 +0400
committerJunio C Hamano <gitster@pobox.com>2013-05-16 22:51:08 +0400
commit83f0412f3fff3b4108e7f05c30f3e861d148f5f2 (patch)
tree59de20ddc75c27636de50f474b6c79d5d16c0efc /decorate.c
parenta765499a0884375c47c78d0d1e2926e875074427 (diff)
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>
Diffstat (limited to 'decorate.c')
-rw-r--r--decorate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/decorate.c b/decorate.c
index 2f8a63e388..7cb5d29a89 100644
--- a/decorate.c
+++ b/decorate.c
@@ -49,7 +49,7 @@ static void grow_decoration(struct decoration *n)
const struct object *base = old_hash[i].base;
void *decoration = old_hash[i].decoration;
- if (!base)
+ if (!decoration)
continue;
insert_decoration(n, base, decoration);
}