Skip to content

Commit

Permalink
str_list_contains: use g_slist_find_custom as wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
nick87720z committed Mar 22, 2022
1 parent bfea751 commit c563018
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/launcher/icon-theme-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,7 @@ static char *icon_extensions[] = {
"", NULL
};

gboolean str_list_contains(const GSList *list, const char *value)
{
// return g_slist_find_custom (list, value, g_str_equal) ? TRUE : FALSE;
// FIXME: above variant gives different result than below

for (const GSList *item = list; item; item = item->next)
{
if (g_str_equal(item->data, value))
return TRUE;
}
return FALSE;
}
//~ #define str_list_contains(list, value) (g_slist_find_custom (list, value, g_str_equal) != NULL)
#define str_list_contains(list, value) (g_slist_find_custom (list, value, (GCompareFunc )strcmp) != NULL)

const GSList *get_icon_locations()
{
Expand Down

0 comments on commit c563018

Please sign in to comment.