Skip to content

Commit

Permalink
Simplify the API when we cannot fail
Browse files Browse the repository at this point in the history
  • Loading branch information
gahr authored and flatcap committed Dec 12, 2018
1 parent 408c86b commit e3d4cff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,8 +1117,7 @@ static int parse_group(struct Buffer *buf, struct Buffer *s, unsigned long data,

if (data == MUTT_UNGROUP && (mutt_str_strcasecmp(buf->data, "*") == 0))
{
if (mutt_group_context_clear(&gc) < 0)
goto bail;
mutt_group_context_clear(&gc);
goto out;
}

Expand Down
4 changes: 1 addition & 3 deletions mutt/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ static void group_remove(struct Group *g)
/**
* mutt_group_context_clear - Clear a GroupList
* @param head GroupList to clear
* @retval 0 Always
*/
int mutt_group_context_clear(struct GroupList *head)
void mutt_group_context_clear(struct GroupList *head)
{
struct GroupNode *np = STAILQ_FIRST(head), *next = NULL;
while (np)
Expand All @@ -108,7 +107,6 @@ int mutt_group_context_clear(struct GroupList *head)
np = next;
}
STAILQ_INIT(head);
return 0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion mutt/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int mutt_group_context_add_regex(struct GroupList *head, const char *s,

bool mutt_group_match(struct Group *g, const char *s);

int mutt_group_context_clear(struct GroupList *head);
void mutt_group_context_clear(struct GroupList *head);
int mutt_group_context_remove_regex(struct GroupList *head, const char *s);
int mutt_group_context_remove_addrlist(struct GroupList *head, struct Address *a);

Expand Down

0 comments on commit e3d4cff

Please sign in to comment.