[gnome-commander] Do not use extra variable for storing file name in comparison



commit 5b2780fb74d1292bc1caa39d115f48ea576fd3dd
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sat Apr 2 21:44:27 2022 +0200

    Do not use extra variable for storing file name in comparison

 src/gnome-cmd-file-list.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index 93d17068..b0fd7a00 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -2305,17 +2305,14 @@ void GnomeCmdFileList::focus_file(const gchar *file_to_focus, gboolean scroll_to
         if (row == -1)
             return;
 
-        auto basename = g_file_get_basename(f->gFile);
-        if (basename && strcmp (basename, file_to_focus) == 0)
+        if (strcmp (f->get_name(), file_to_focus) == 0)
         {
-            g_free(basename);
             priv->cur_file = row;
             focus_file_at_row (this, row);
             if (scroll_to_file)
                 gtk_clist_moveto (*this, row, 0, 0, 0);
             return;
         }
-        g_free(basename);
     }
 
     /* The file was not found, remember the filename in case the file gets


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