devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=da22b6fc669fc1117d27f4bed12b77a9d623eca1

commit da22b6fc669fc1117d27f4bed12b77a9d623eca1
Author: Chris Michael <[email protected]>
Date:   Tue Feb 28 12:36:05 2017 -0500

    ecore-wl2: Cleanup function for finding global
    
    As per Mike, the iterator macro already does the casting for us, so we
    can cleanup the code here and not do casting, plus we can remove an
    extra variable...bonus ;)
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_wl2/ecore_wl2_display.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c 
b/src/lib/ecore_wl2/ecore_wl2_display.c
index 2437699..c38e383 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -405,22 +405,16 @@ static Ecore_Wl2_Global *
 _ecore_wl2_global_find(Ecore_Wl2_Display *ewd, const char *interface)
 {
    Eina_Iterator *itr;
-   Ecore_Wl2_Global *global = NULL;
-   void *data;
+   Ecore_Wl2_Global *global = NULL, *g = NULL;
 
    itr = eina_hash_iterator_data_new(ewd->globals);
    if (!itr) return NULL;
 
-   EINA_ITERATOR_FOREACH(itr, data)
+   EINA_ITERATOR_FOREACH(itr, g)
      {
-        Ecore_Wl2_Global *g = NULL;
-
-        g = (Ecore_Wl2_Global *)data;
-        if (!g) continue;
-
         if (!strcmp(g->interface, interface))
           {
-             global = data;
+             global = g;
              break;
           }
      }

-- 


Reply via email to