From 92c3837f6eac939d53ab530abd390ab701631d81 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 18 Mar 2024 10:57:27 +0100 Subject: [PATCH] cleanup: remove unused taglist functions No users of taglist_added() and taglist_contains(). Signed-off-by: Berthold Stoeger --- core/tag.c | 22 ---------------------- core/tag.h | 2 -- 2 files changed, 24 deletions(-) diff --git a/core/tag.c b/core/tag.c index 66dcfcef8..bf8327182 100644 --- a/core/tag.c +++ b/core/tag.c @@ -181,25 +181,3 @@ void taglist_init_global() for (i = 0; i < sizeof(default_tags) / sizeof(char *); i++) taglist_add_tag(&g_tag_list, default_tags[i]); } - -bool taglist_contains(struct tag_entry *tag_list, const char *tag) -{ - while (tag_list) { - if (same_string(tag_list->tag->name, tag)) - return true; - tag_list = tag_list->next; - } - return false; -} - -struct tag_entry *taglist_added(struct tag_entry *original_list, struct tag_entry *new_list) -{ - struct tag_entry *added_list = NULL; - while (new_list) { - if (!taglist_contains(original_list, new_list->tag->name)) - taglist_add_tag(&added_list, new_list->tag->name); - new_list = new_list->next; - } - return added_list; -} - diff --git a/core/tag.h b/core/tag.h index 1f50dc920..bd2642278 100644 --- a/core/tag.h +++ b/core/tag.h @@ -35,7 +35,6 @@ struct tag_entry { extern struct tag_entry *g_tag_list; struct divetag *taglist_add_tag(struct tag_entry **tag_list, const char *tag); -struct tag_entry *taglist_added(struct tag_entry *original_list, struct tag_entry *new_list); /* * Writes all divetags form tag_list into internally allocated buffer @@ -52,7 +51,6 @@ void taglist_cleanup(struct tag_entry **tag_list); void taglist_init_global(); void taglist_free(struct tag_entry *tag_list); struct tag_entry *taglist_copy(struct tag_entry *s); -bool taglist_contains(struct tag_entry *tag_list, const char *tag); void taglist_merge(struct tag_entry **dst, struct tag_entry *src1, struct tag_entry *src2); #ifdef __cplusplus