From ac51f4ead305b115c94e2908c81c7146544a6c1b Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Thu, 9 Dec 2010 08:56:23 +0000 Subject: [PATCH] Fix very weird double looping Not need to extract keys from hash, then loop keys to find data. SVN revision: 55395 --- legacy/efreet/src/lib/efreet_icon.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/legacy/efreet/src/lib/efreet_icon.c b/legacy/efreet/src/lib/efreet_icon.c index 769d905f40..f97842dace 100644 --- a/legacy/efreet/src/lib/efreet_icon.c +++ b/legacy/efreet/src/lib/efreet_icon.c @@ -279,12 +279,6 @@ efreet_icon_extra_list_get(void) return &efreet_extra_icon_dirs; } -static Eina_Bool -_hash_keys(Eina_Hash *hash __UNUSED__, const void *key, void *list) -{ - *(Eina_List**)list = eina_list_append(*(Eina_List**)list, key); - return EINA_TRUE; -} /** * @return Returns a list of Efreet_Icon structs for all the non-hidden icon * themes @@ -295,23 +289,16 @@ EAPI Eina_List * efreet_icon_theme_list_get(void) { Eina_List *list = NULL; - Eina_List *theme_list = NULL; - char *dir; Eina_Iterator *it; + Efreet_Icon_Theme *theme; /* update the list to include all icon themes */ efreet_icon_theme_dir_scan_all(NULL); /* create the list for the user */ - it = eina_hash_iterator_key_new(efreet_icon_themes); - eina_iterator_foreach(it, EINA_EACH_CB(_hash_keys), &theme_list); - eina_iterator_free(it); - - EINA_LIST_FREE(theme_list, dir) + it = eina_hash_iterator_data_new(efreet_icon_themes); + EINA_ITERATOR_FOREACH(it, theme) { - Efreet_Icon_Theme *theme; - - theme = eina_hash_find(efreet_icon_themes, dir); if (theme->hidden || !theme->valid) continue; #ifndef STRICT_SPEC if (!theme->name.name) continue; @@ -319,6 +306,7 @@ efreet_icon_theme_list_get(void) list = eina_list_append(list, theme); } + eina_iterator_free(it); return list; }