Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/data


Modified Files:
        evas_object_list.c 


Log Message:


optimisipoos. (e17's menus should be more responsive now)

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/data/evas_object_list.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- evas_object_list.c  8 Nov 2002 08:02:14 -0000       1.1
+++ evas_object_list.c  3 Apr 2005 14:22:17 -0000       1.2
@@ -51,76 +51,60 @@
 void *
 evas_object_list_append_relative(void *in_list, void *in_item, void 
*in_relative)
 {
-   Evas_Object_List *l;
-   Evas_Object_List *list, *item, *relative;
+   Evas_Object_List *list, *relative, *new_l;
    
    list = in_list;
-   item = in_item;
+   new_l = in_item;
    relative = in_relative;
-   for (l = list; l; l = l->next)
+   if (relative)
      {
-       if (l == relative)
+       if (relative->next)
          {
-            Evas_Object_List *new_l;
-            
-            new_l = item;
-            if (l->next)
-              {
-                 new_l->next = l->next;
-                 l->next->prev = new_l;
-              }
-
-            else new_l->next = NULL;
-            l->next = new_l;
-            new_l->prev = l;
-            if (!new_l->next)
-              list->last = new_l;
-            return list;
+            new_l->next = relative->next;
+            relative->next->prev = new_l;
          }
+       else new_l->next = NULL;
+       relative->next = new_l;
+       new_l->prev = relative;
+       if (!new_l->next) list->last = new_l;
+       return list;
      }
-   return evas_object_list_append(list, item);
+   return evas_object_list_append(list, new_l);
 }
 
 void *
 evas_object_list_prepend_relative(void *in_list, void *in_item, void 
*in_relative)
 {
-   Evas_Object_List *l;
-   Evas_Object_List *list, *item, *relative;
+   Evas_Object_List *list, *relative, *new_l;
    
    list = in_list;
-   item = in_item;
+   new_l = in_item;
    relative = in_relative;
-   for (l = list; l; l = l->next)
+   if (relative)
      {
-       if (l == relative)
+       new_l->prev = relative->prev;
+       new_l->next = relative;
+       relative->prev = new_l;
+       if (new_l->prev)
          {
-            Evas_Object_List *new_l;
-            
-            new_l = item;
-            new_l->prev = l->prev;
-            new_l->next = l;
-            l->prev = new_l;
-            if (new_l->prev)
-              {
-                 new_l->prev->next = new_l;
-                 if (!new_l->next)
-                   list->last = new_l;
-                 return list;
-              }
+            new_l->prev->next = new_l;
+            if (!new_l->next)
+              list->last = new_l;
+            return list;
+         }
+       else
+         {
+            if (!new_l->next)
+              new_l->last = new_l;
             else
               {
-                 if (!new_l->next)
-                   new_l->last = new_l;
-                 else
-                   {
-                      new_l->last = list->last;
-                      list->last = NULL;
-                   }
-                 return new_l;
+                 new_l->last = list->last;
+                 list->last = NULL;
               }
+            return new_l;
          }
      }
-   return evas_object_list_prepend(list, item);
+   return evas_object_list_prepend(list, new_l);
 }
 
 void *




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to