[Xfce4-commits] <tumbler:master> Don't use GString for a simple concat.

Nick Schermer noreply at xfce.org
Sat Dec 8 00:20:04 CET 2012


Updating branch refs/heads/master
         to 0093f278c4dfe45e404ae502aa0e3c817f7a38fc (commit)
       from 89b2e5ddd1467cf5ed62c7d1e376ef07109c9f92 (commit)

commit 0093f278c4dfe45e404ae502aa0e3c817f7a38fc
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Dec 7 23:38:41 2012 +0100

    Don't use GString for a simple concat.

 tumblerd/tumbler-registry.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/tumblerd/tumbler-registry.c b/tumblerd/tumbler-registry.c
index fc4a513..5f8c8ab 100644
--- a/tumblerd/tumbler-registry.c
+++ b/tumblerd/tumbler-registry.c
@@ -473,7 +473,7 @@ tumbler_registry_update_supported (TumblerRegistry *registry)
   GList         *thumbnailers;
   GList         *lp;
   const gchar  **pair;
-  GString       *pair_string;
+  gchar         *pair_string;
   gchar        **mime_types;
   gchar        **uri_schemes;
   gint           n;
@@ -541,15 +541,10 @@ tumbler_registry_update_supported (TumblerRegistry *registry)
               pair[1] = mime_types[n];
 
               /* combine the two to a unique pair identifier */
-              pair_string = g_string_new (pair[0]);
-              g_string_append_c (pair_string, '-');
-              g_string_append (pair_string, pair[1]);
+              pair_string = g_strdup_printf ("%s-%s", pair[0], pair[1]);
 
               /* remember the pair in the hash table */
-              g_hash_table_insert (unique_pairs, pair_string->str, pair);
-
-              /* free the pair string */
-              g_string_free (pair_string, FALSE);
+              g_hash_table_insert (unique_pairs, pair_string, pair);
             }
         }
 


More information about the Xfce4-commits mailing list