From 87955e5d078f07808097189bee163847493f223c Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 24 Dec 2008 15:11:17 -0800 Subject: [PATCH] Make tag_set_add() avoid adding tags that are already present. --- lib/tag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tag.c b/lib/tag.c index 9cca57a0..ed198fcb 100644 --- a/lib/tag.c +++ b/lib/tag.c @@ -82,7 +82,7 @@ tag_set_init(struct tag_set *set) void tag_set_add(struct tag_set *set, tag_type tag) { - if (tag) { + if (tag && (!tag_is_valid(tag) || !tag_set_intersects(set, tag))) { /* XXX We could do better by finding the set member to which we would * add the fewest number of 1-bits. This would reduce the amount of * ambiguity, since e.g. three 1-bits match 3 * 2 / 2 = 3 unique tags -- 2.30.2