Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'rt/string-list-lookup-cleanup' into HEAD
author
Junio C Hamano
<gitster@pobox.com>
Wed, 18 May 2016 21:40:12 +0000
(14:40 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 18 May 2016 21:40:12 +0000
(14:40 -0700)
Code cleanup.
* rt/string-list-lookup-cleanup:
string_list: use string-list API in unsorted_string_list_lookup()
string-list.c
patch
|
blob
|
history
raw
(from parent 1:
9ba3b14
)
diff --git
a/string-list.c
b/string-list.c
index 2a32a3f1f5d250d7ea2a1b4a65998eeddb44962e..62d20846cbead5aba6a4b3859475b454ad606205 100644
(file)
--- 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;
}