- change find to leave the list pointing to the found item instead of the
authorDan Sinclair <dj2>
Wed, 10 Jan 2007 21:56:11 +0000 (21:56 +0000)
committerDan Sinclair <dj2@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 10 Jan 2007 21:56:11 +0000 (21:56 +0000)
  next item in the list

SVN revision: 27899

legacy/ecore/src/lib/ecore/ecore_list.c

index e08c9f5..7de969f 100644 (file)
@@ -1051,8 +1051,11 @@ _ecore_list_find(Ecore_List *list, Ecore_Compare_Cb function, const void *user_d
   if (!list || !function) return NULL;
 
   _ecore_list_goto_first(list);
-  while ((value = _ecore_list_next(list)) != NULL)
+  while ((value = _ecore_list_current(list)) != NULL)
+  {
     if (!function(value, user_data)) return value;
+    ecore_list_next(list);
+  }
 
   return NULL;
 }