Removed unused boolean result from autocomplete add and remove
This commit is contained in:
@@ -82,7 +82,7 @@ autocomplete_length(Autocomplete ac)
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
void
|
||||
autocomplete_add(Autocomplete ac, const char *item)
|
||||
{
|
||||
char *item_cpy;
|
||||
@@ -90,21 +90,21 @@ autocomplete_add(Autocomplete ac, const char *item)
|
||||
|
||||
// if item already exists
|
||||
if (curr != NULL) {
|
||||
return FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
item_cpy = strdup(item);
|
||||
ac->items = g_slist_insert_sorted(ac->items, item_cpy, (GCompareFunc)strcmp);
|
||||
return TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
gboolean
|
||||
void
|
||||
autocomplete_remove(Autocomplete ac, const char * const item)
|
||||
{
|
||||
GSList *curr = g_slist_find_custom(ac->items, item, (GCompareFunc)strcmp);
|
||||
|
||||
if (!curr) {
|
||||
return FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
// reset last found if it points to the item to be removed
|
||||
@@ -115,7 +115,7 @@ autocomplete_remove(Autocomplete ac, const char * const item)
|
||||
free(curr->data);
|
||||
ac->items = g_slist_delete_link(ac->items, curr);
|
||||
|
||||
return TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
GSList *
|
||||
|
||||
@@ -32,8 +32,8 @@ Autocomplete autocomplete_new(void);
|
||||
void autocomplete_clear(Autocomplete ac);
|
||||
void autocomplete_reset(Autocomplete ac);
|
||||
void autocomplete_free(Autocomplete ac);
|
||||
gboolean autocomplete_add(Autocomplete ac, const char *item);
|
||||
gboolean autocomplete_remove(Autocomplete ac, const char * const item);
|
||||
void autocomplete_add(Autocomplete ac, const char *item);
|
||||
void autocomplete_remove(Autocomplete ac, const char * const item);
|
||||
GSList * autocomplete_get_list(Autocomplete ac);
|
||||
gchar * autocomplete_complete(Autocomplete ac, gchar *search_str);
|
||||
gint autocomplete_length(Autocomplete ac);
|
||||
|
||||
Reference in New Issue
Block a user