diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-05-18 14:40:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-05-18 14:40:12 -0700 |
commit | 87c594471d3ee696b0137a851385f091e623b00c (patch) | |
tree | 996bcc95b6483c1cce1402bf4ced6b174d2b676c | |
parent | 9ba3b14c64345838310797d5a5cebbf12e2daca3 (diff) | |
parent | d16df0c062e45cbaf42b99963d90c77a0ec9b7df (diff) | |
download | git-87c594471d3ee696b0137a851385f091e623b00c.tar.gz |
Merge branch 'rt/string-list-lookup-cleanup' into HEAD
Code cleanup.
* rt/string-list-lookup-cleanup:
string_list: use string-list API in unsorted_string_list_lookup()
-rw-r--r-- | string-list.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/string-list.c b/string-list.c index 2a32a3f1f5..62d20846cb 100644 --- a/string-list.c +++ b/string-list.c @@ -231,12 +231,12 @@ void string_list_sort(struct string_list *list) struct string_list_item *unsorted_string_list_lookup(struct string_list *list, const char *string) { - int i; + struct string_list_item *item; compare_strings_fn cmp = list->cmp ? list->cmp : strcmp; - for (i = 0; i < list->nr; i++) - if (!cmp(string, list->items[i].string)) - return list->items + i; + for_each_string_list_item(item, list) + if (!cmp(string, item->string)) + return item; return NULL; } |