elementary/list - avoid unnecessary checking when deleting sub-objects
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 9 Jun 2011 08:36:55 +0000 (08:36 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 9 Jun 2011 08:36:55 +0000 (08:36 +0000)
git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@60120 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_list.c

index 7158365..6989969 100644 (file)
@@ -659,28 +659,25 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
 
    if (!wd) return;
    if (!sub) abort();
-   if (sub == wd->scr)
-     wd->scr = NULL;
-   else
+   if ((sub == wd->box) || (sub == wd->scr)) return;
+
+   EINA_LIST_FOREACH(wd->items, l, it)
      {
-        EINA_LIST_FOREACH(wd->items, l, it)
+        if ((sub == it->icon) || (sub == it->end))
           {
-             if ((sub == it->icon) || (sub == it->end))
+             if (it->icon == sub) it->icon = NULL;
+             if (it->end == sub) it->end = NULL;
+             evas_object_event_callback_del_full
+             (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints,
+              obj);
+             if (!wd->walking)
                {
-                  if (it->icon == sub) it->icon = NULL;
-                  if (it->end == sub) it->end = NULL;
-                  evas_object_event_callback_del_full
-                     (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints,
-                      obj);
-                  if (!wd->walking)
-                    {
-                       _fix_items(obj);
-                       _sizing_eval(obj);
-                    }
-                  else
-                    wd->fix_pending = EINA_TRUE;
-                  break;
+                  _fix_items(obj);
+                  _sizing_eval(obj);
                }
+             else
+               wd->fix_pending = EINA_TRUE;
+             break;
           }
      }
 }