Browse Source

Merge branch 'rt/string-list-lookup-cleanup'

Code cleanup.

* rt/string-list-lookup-cleanup:
  string_list: use string-list API in unsorted_string_list_lookup()
maint
Junio C Hamano 9 years ago
parent
commit
b342567b2e
  1. 8
      string-list.c

8
string-list.c

@ -231,12 +231,12 @@ void string_list_sort(struct string_list *list) @@ -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;
}


Loading…
Cancel
Save