diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2016-08-22 14:36:50 -0700 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2016-08-22 14:36:50 -0700 |
commit | 983052ddf8084718d646759eb58693249402e396 (patch) | |
tree | 1cea7c63871cac68f2fe5de8ddea00575cff7073 | |
parent | 908cdd062ad318957525609e568d3eea85e4bac3 (diff) | |
download | pkg-config-983052ddf8084718d646759eb58693249402e396.tar.gz |
Remove unused package_list_strip_duplicates
After 908cdd0, there are no more duplicates in the package list and this
function is unused.
-rw-r--r-- | pkg.c | 37 |
1 files changed, 0 insertions, 37 deletions
@@ -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) |