Small optimization. (#348011, Nicolai Weibull)
authorMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2006 19:17:50 +0000 (19:17 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 20 Jul 2006 19:17:50 +0000 (19:17 +0000)
2006-07-20  Matthias Clasen  <mclasen@redhat.com>

* glib/guniprop.c (real_toupper, real_tolower): Small optimization.
(#348011, Nicolai Weibull)

ChangeLog
ChangeLog.pre-2-12
glib/guniprop.c

index af6d1a6..6b79678 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-20  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/guniprop.c (real_toupper, real_tolower): Small optimization.
+       (#348011, Nicolai Weibull)
+
 2006-07-19  Behdad Esfahbod  <behdad@gnome.org>
 
        * glib/gunibreak.h:
index af6d1a6..6b79678 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-20  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/guniprop.c (real_toupper, real_tolower): Small optimization.
+       (#348011, Nicolai Weibull)
+
 2006-07-19  Behdad Esfahbod  <behdad@gnome.org>
 
        * glib/gunibreak.h:
index 2f5567f..b3e2956 100644 (file)
@@ -320,8 +320,8 @@ g_unichar_istitle (gunichar c)
   unsigned int i;
   for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
     if (title_table[i][0] == c)
-      return 1;
-  return 0;
+      return TRUE;
+  return FALSE;
 }
 
 /**
@@ -823,7 +823,10 @@ real_toupper (const gchar *str,
                  for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
                    {
                      if (title_table[i][0] == c)
-                       val = title_table[i][1];
+                       {
+                         val = title_table[i][1];
+                         break;
+                       }
                    }
                }
 
@@ -1007,7 +1010,10 @@ real_tolower (const gchar *str,
                  for (i = 0; i < G_N_ELEMENTS (title_table); ++i)
                    {
                      if (title_table[i][0] == c)
-                       val = title_table[i][2];
+                       {
+                         val = title_table[i][2];
+                         break;
+                       }
                    }
                }