[banshee] Replace String.Format calls with String.Concat, small performance gain



commit bd857b68fcc5d74e1952de50b6debe172d89ed0c
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Thu May 21 18:56:09 2009 +0200

    Replace String.Format calls with String.Concat, small performance gain
    
    This reduces CPU and memory usage a little bit on startup.
---
 .../GConfConfigurationClient.cs                    |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs b/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs
index 7c646c4..09186b3 100644
--- a/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs
+++ b/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs
@@ -60,19 +60,19 @@ namespace Banshee.GnomeBackend
 
         private string CreateKey (string @namespace, string part)
         {
-            string hash_key = String.Format ("{0}{1}", @namespace, part);
+            string hash_key = String.Concat (@namespace, part);
             lock (((ICollection)key_table).SyncRoot) {
                 if (!key_table.ContainsKey (hash_key)) {
                     part = part.Replace ('/', '_');
                     if (@namespace == null) {
-                        key_table.Add (hash_key, String.Format ("{0}{1}", base_key, StringUtil.CamelCaseToUnderCase (part)));
+                        key_table.Add (hash_key, String.Concat (base_key, StringUtil.CamelCaseToUnderCase (part)));
                     } else if (@namespace.StartsWith ("/")) {
-                        key_table.Add (hash_key, String.Format ("{0}{1}{2}", @namespace,
+                        key_table.Add (hash_key, String.Concat (@namespace,
                             @namespace.EndsWith ("/") ? String.Empty : "/", StringUtil.CamelCaseToUnderCase (part)));
                     } else {
                         @namespace = @namespace.Replace ('/', '_');
-                        key_table.Add (hash_key, String.Format ("{0}{1}",
-                            base_key, StringUtil.CamelCaseToUnderCase (String.Format ("{0}/{1}", @namespace.Replace (".", "/"), part))
+                        key_table.Add (hash_key, String.Concat (base_key,
+                            StringUtil.CamelCaseToUnderCase (String.Concat (@namespace.Replace (".", "/"), "/", part))
                         ));
                     }
 



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