Skip to content

Commit 8bfac19

Browse files
mhaggergitster
authored andcommitted
entry_matches(): inline function
It wasn't pulling its weight. And in a moment we will need similar tests that take a refname rather than a ref_entry as parameter, which would have made entry_matches() even less useful. Signed-off-by: Michael Haggerty <[email protected]>
1 parent 6075f30 commit 8bfac19

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

refs.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -841,11 +841,6 @@ static void prime_ref_dir(struct ref_dir *dir)
841841
}
842842
}
843843

844-
static int entry_matches(struct ref_entry *entry, const struct string_list *list)
845-
{
846-
return list && string_list_has_string(list, entry->name);
847-
}
848-
849844
struct nonmatching_ref_data {
850845
const struct string_list *skip;
851846
struct ref_entry *found;
@@ -855,7 +850,7 @@ static int nonmatching_ref_fn(struct ref_entry *entry, void *vdata)
855850
{
856851
struct nonmatching_ref_data *data = vdata;
857852

858-
if (entry_matches(entry, data->skip))
853+
if (data->skip && string_list_has_string(data->skip, entry->name))
859854
return 0;
860855

861856
data->found = entry;
@@ -908,7 +903,7 @@ static int is_refname_available(const char *refname,
908903
* prefix of refname; e.g., "refs/foo".
909904
*/
910905
struct ref_entry *entry = dir->entries[pos];
911-
if (entry_matches(entry, skip)) {
906+
if (skip && string_list_has_string(skip, entry->name)) {
912907
/*
913908
* The reference we just found, e.g.,
914909
* "refs/foo", is also in skip, so it

0 commit comments

Comments
 (0)