eo: little micro optimization.
authorCedric Bail <cedric.bail@samsung.com>
Mon, 1 Jul 2013 09:35:55 +0000 (18:35 +0900)
committerCedric Bail <cedric.bail@samsung.com>
Mon, 1 Jul 2013 09:35:55 +0000 (18:35 +0900)
src/lib/eo/eo_base_class.c

index 49cfe7f..2cde9ff 100644 (file)
@@ -314,14 +314,14 @@ _eo_callbacks_clear(Private_Data *pd)
 {
    Eo_Callback_Description *cb = NULL;
 
-   /* Abort if we are currently walking the list. */
-   if (pd->walking_list > 0)
-      return;
-
    /* If there are no deletions waiting. */
    if (!pd->deletions_waiting)
       return;
 
+   /* Abort if we are currently walking the list. */
+   if (pd->walking_list > 0)
+      return;
+
    pd->deletions_waiting = EINA_FALSE;
 
    for (cb = pd->callbacks ; cb ; )
@@ -501,20 +501,19 @@ _ev_cb_call(Eo *obj_id, void *class_data, va_list *list)
                }
              else
                {
+                  if (cb->items.item.desc != desc)
+                    continue;
                   if ((!cb->items.item.desc
                        || !cb->items.item.desc->unfreezable) &&
                       (event_freeze_count || pd->event_freeze_count))
                     continue;
 
-                  if (cb->items.item.desc == desc)
+                  /* Abort callback calling if the func says so. */
+                  if (!cb->items.item.func((void *) cb->func_data, obj_id, desc,
+                                           (void *) event_info))
                     {
-                       /* Abort callback calling if the func says so. */
-                       if (!cb->items.item.func((void *) cb->func_data, obj_id, desc,
-                                (void *) event_info))
-                         {
-                            if (ret) *ret = EINA_FALSE;
-                            goto end;
-                         }
+                       if (ret) *ret = EINA_FALSE;
+                       goto end;
                     }
                }
           }