From 983052ddf8084718d646759eb58693249402e396 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Mon, 22 Aug 2016 14:36:50 -0700 Subject: Remove unused package_list_strip_duplicates After 908cdd0, there are no more duplicates in the package list and this function is unused. --- pkg.c | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/pkg.c b/pkg.c index da3b3f4..5aa4380 100644 --- a/pkg.c +++ b/pkg.c @@ -599,43 +599,6 @@ merge_flag_lists (GList *packages, FlagType type) return merged; } -/* Work backwards from the end of the package list to remove duplicate - * packages. This could happen because the package was specified multiple - * times on the command line, or because multiple packages require the same - * package. When we have duplicate dependencies, starting from the end of the - * list ensures that the dependency shows up later in the package list and - * Libs will come out correctly. */ -static GList * -package_list_strip_duplicates (GList *packages) -{ - GList *cur; - GHashTable *requires; - - requires = g_hash_table_new (g_str_hash, g_str_equal); - for (cur = g_list_last (packages); cur != NULL; cur = g_list_previous (cur)) - { - Package *pkg = cur->data; - - if (g_hash_table_lookup_extended (requires, pkg->key, NULL, NULL)) - { - GList *dup = cur; - - /* Remove the duplicate package from the list */ - debug_spew ("Removing duplicate package %s\n", pkg->key); - cur = cur->next; - packages = g_list_delete_link (packages, dup); - } - else - { - /* Unique package. Track it and move to the next. */ - g_hash_table_replace (requires, pkg->key, pkg->key); - } - } - g_hash_table_destroy (requires); - - return packages; -} - static GList * fill_list (GList *packages, FlagType type, gboolean in_path_order, gboolean include_private) -- cgit v1.2.1