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:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-09-12 18:04:45 +0400
committerJunio C Hamano <gitster@pobox.com>2012-09-12 22:43:25 +0400
commit31d5451eed2677531c80177ff9dc8f5285f5a187 (patch)
treebd709b58ba3096867e2f6166f516773b67aad0e1 /string-list.h
parenteb5f0c7a616531a024a582b72ca6d8775ff98d46 (diff)
string_list: add a new function, string_list_remove_duplicates()
Add a function that deletes duplicate entries from a sorted string_list. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'string-list.h')
-rw-r--r--string-list.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/string-list.h b/string-list.h
index 7d18e622ec..3a6a6dc392 100644
--- a/string-list.h
+++ b/string-list.h
@@ -48,6 +48,13 @@ struct string_list_item *string_list_insert_at_index(struct string_list *list,
int insert_at, const char *string);
struct string_list_item *string_list_lookup(struct string_list *list, const char *string);
+/*
+ * Remove all but the first of consecutive entries with the same
+ * string value. If free_util is true, call free() on the util
+ * members of any items that have to be deleted.
+ */
+void string_list_remove_duplicates(struct string_list *sorted_list, int free_util);
+
/* Use these functions only on unsorted lists: */