[easytag] Simplify ET_Displayed_File_List_By_Etfile()



commit 89f11ef54025dbe83a8bfedf760dc47850ec3653
Author: David King <amigadave amigadave com>
Date:   Fri Nov 13 18:58:21 2015 +0000

    Simplify ET_Displayed_File_List_By_Etfile()
    
    Use g_list_find() rather than a custom list search implementation.

 src/file_list.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/file_list.c b/src/file_list.c
index f19ba58..4d79b43 100644
--- a/src/file_list.c
+++ b/src/file_list.c
@@ -1146,12 +1146,8 @@ ET_Displayed_File_List_By_Etfile (const ET_File *ETFile)
 {
     GList *etfilelist;
 
-    for (etfilelist = ET_Displayed_File_List_First (); etfilelist != NULL;
-         etfilelist = ET_Displayed_File_List_Next ())
-    {
-        if (ETFile == (ET_File *)etfilelist->data)
-            break;
-    }
+    etfilelist = g_list_find (g_list_first (ETCore->ETFileDisplayedList),
+                              ETFile);
 
     if (etfilelist)
     {
@@ -1159,6 +1155,7 @@ ET_Displayed_File_List_By_Etfile (const ET_File *ETFile)
          * FIXME) */
         ETCore->ETFileDisplayedList = etfilelist;
     }
+
     return etfilelist;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]