e_mod_pol_pingpong: code cleanup 99/239499/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 27 Jul 2020 07:11:38 +0000 (16:11 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 27 Jul 2020 07:11:38 +0000 (16:11 +0900)
Change-Id: Id66df8af61fb2a806b304eac5006172e6e251426

src/e_mod_pol_pingpong.c

index 154c2d7..29d870e 100644 (file)
@@ -65,6 +65,18 @@ _pp_win_find(E_Client *ec)
    return NULL;
 }
 
+static void
+_pp_win_remove(E_Client *ec)
+{
+   PP_Win *ppw = NULL;
+
+   ppw = _pp_win_find(ec);
+   if (!ppw) return;
+
+   _pp_wins = eina_list_remove(_pp_wins, ppw);
+   _pp_win_del(ppw);
+}
+
 static Eina_Bool
 _cb_pong_check(void *data)
 {
@@ -188,15 +200,10 @@ _cb_client_hide(void *data EINA_UNUSED,
                 int type EINA_UNUSED,
                 void *event)
 {
-   PP_Win *ppw = NULL;
    E_Event_Client *ev = (E_Event_Client *)event;
-   E_Client *ec = ev->ec;
-
-   ppw = _pp_win_find(ec);
-   if (!ppw) return ECORE_CALLBACK_PASS_ON;
 
-   _pp_wins = eina_list_remove(_pp_wins, ppw);
-   _pp_win_del(ppw);
+   if (ev->ec)
+     _pp_win_remove(ev->ec);
 
    return ECORE_CALLBACK_PASS_ON;
 }
@@ -206,15 +213,10 @@ _cb_client_del(void *data EINA_UNUSED,
                int type EINA_UNUSED,
                void *event)
 {
-   PP_Win *ppw = NULL;
    E_Event_Client *ev = (E_Event_Client *)event;
-   E_Client *ec = ev->ec;
-
-   ppw = _pp_win_find(ec);
-   if (!ppw) return ECORE_CALLBACK_PASS_ON;
 
-   _pp_wins = eina_list_remove(_pp_wins, ppw);
-   _pp_win_del(ppw);
+   if (ev->ec)
+     _pp_win_remove(ev->ec);
 
    return ECORE_CALLBACK_PASS_ON;
 }