[Pkg-privacy-commits] [nautilus-wipe] 108/224: Don't do useless and maybe wrong optimizations

Ulrike Uhlig u-guest at moszumanska.debian.org
Thu Jul 7 19:45:39 UTC 2016


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch master
in repository nautilus-wipe.

commit c7989c01af72000cea6b15484220db895c967b4a
Author: Colomban Wendling <ban at herbesfolles.org>
Date:   Thu Apr 28 20:38:48 2011 +0200

    Don't do useless and maybe wrong optimizations
---
 nautilus-srm/nautilus-srm.c    |  9 ++-------
 nautilus-srm/progress-dialog.c | 12 ++++--------
 2 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/nautilus-srm/nautilus-srm.c b/nautilus-srm/nautilus-srm.c
index 0b52fbb..cdc1b13 100644
--- a/nautilus-srm/nautilus-srm.c
+++ b/nautilus-srm/nautilus-srm.c
@@ -228,13 +228,8 @@ nautilus_srm_nfi_get_path (NautilusFileInfo *nfi)
 void
 nautilus_srm_path_list_free (GList *paths)
 {
-  while (paths) {
-    GList *tmp = paths;
-    
-    paths = g_list_next (paths);
-    g_free (tmp->data);
-    g_list_free_1 (tmp);
-  }
+  g_list_foreach (paths, (GFunc)g_free, NULL);
+  g_list_free (paths);
 }
 
 /* copies a list of paths
diff --git a/nautilus-srm/progress-dialog.c b/nautilus-srm/progress-dialog.c
index 66b12f2..8c8b08b 100644
--- a/nautilus-srm/progress-dialog.c
+++ b/nautilus-srm/progress-dialog.c
@@ -140,21 +140,17 @@ update_action_area_visibility (NautilusSrmProgressDialog *dialog,
 {
   if (dialog->priv->auto_hide_action_area || force_show) {
     GtkWidget  *container;
-    GList      *children;
     guint       n_children = 0;
     
     container = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
     if (force_show) {
       n_children = 1;
     } else {
+      GList *children;
+      
       children = gtk_container_get_children (GTK_CONTAINER (container));
-      while (children) {
-        GList *tmp = children;
-        
-        n_children ++;
-        children = g_list_next (children);
-        g_list_free1 (tmp);
-      }
+      n_children = g_list_length (children);
+      g_list_free (children);
     }
     
     gtk_dialog_set_has_separator (GTK_DIALOG (dialog), n_children > 0);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/nautilus-wipe.git



More information about the Pkg-privacy-commits mailing list