Use a switch here, maybe helps the compiler optimize things. Also, ' ' is
authorHavoc Pennington <hp@redhat.com>
Mon, 20 Nov 2000 15:14:14 +0000 (15:14 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Mon, 20 Nov 2000 15:14:14 +0000 (15:14 +0000)
2000-11-16  Havoc Pennington  <hp@redhat.com>

* guniprop.c (g_unichar_isspace): Use a switch here, maybe helps
the compiler optimize things. Also, ' ' is a SPACE_SEPARATOR,
so don't special case it.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/guniprop.c
guniprop.c

index f0cd3ce..c01c529 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-11-16  Havoc Pennington  <hp@redhat.com>
+
+       * guniprop.c (g_unichar_isspace): Use a switch here, maybe helps 
+       the compiler optimize things. Also, ' ' is a SPACE_SEPARATOR,
+       so don't special case it.
+
 2000-11-17  Tor Lillqvist  <tml@iki.fi>
 
        * glib.def: Add g_trash_stack entry points.
index f0cd3ce..c01c529 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-16  Havoc Pennington  <hp@redhat.com>
+
+       * guniprop.c (g_unichar_isspace): Use a switch here, maybe helps 
+       the compiler optimize things. Also, ' ' is a SPACE_SEPARATOR,
+       so don't special case it.
+
 2000-11-17  Tor Lillqvist  <tml@iki.fi>
 
        * glib.def: Add g_trash_stack entry points.
index f0cd3ce..c01c529 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-16  Havoc Pennington  <hp@redhat.com>
+
+       * guniprop.c (g_unichar_isspace): Use a switch here, maybe helps 
+       the compiler optimize things. Also, ' ' is a SPACE_SEPARATOR,
+       so don't special case it.
+
 2000-11-17  Tor Lillqvist  <tml@iki.fi>
 
        * glib.def: Add g_trash_stack entry points.
index f0cd3ce..c01c529 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-16  Havoc Pennington  <hp@redhat.com>
+
+       * guniprop.c (g_unichar_isspace): Use a switch here, maybe helps 
+       the compiler optimize things. Also, ' ' is a SPACE_SEPARATOR,
+       so don't special case it.
+
 2000-11-17  Tor Lillqvist  <tml@iki.fi>
 
        * glib.def: Add g_trash_stack entry points.
index f0cd3ce..c01c529 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-16  Havoc Pennington  <hp@redhat.com>
+
+       * guniprop.c (g_unichar_isspace): Use a switch here, maybe helps 
+       the compiler optimize things. Also, ' ' is a SPACE_SEPARATOR,
+       so don't special case it.
+
 2000-11-17  Tor Lillqvist  <tml@iki.fi>
 
        * glib.def: Add g_trash_stack entry points.
index f0cd3ce..c01c529 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-16  Havoc Pennington  <hp@redhat.com>
+
+       * guniprop.c (g_unichar_isspace): Use a switch here, maybe helps 
+       the compiler optimize things. Also, ' ' is a SPACE_SEPARATOR,
+       so don't special case it.
+
 2000-11-17  Tor Lillqvist  <tml@iki.fi>
 
        * glib.def: Add g_trash_stack entry points.
index f0cd3ce..c01c529 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-16  Havoc Pennington  <hp@redhat.com>
+
+       * guniprop.c (g_unichar_isspace): Use a switch here, maybe helps 
+       the compiler optimize things. Also, ' ' is a SPACE_SEPARATOR,
+       so don't special case it.
+
 2000-11-17  Tor Lillqvist  <tml@iki.fi>
 
        * glib.def: Add g_trash_stack entry points.
index f0cd3ce..c01c529 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-16  Havoc Pennington  <hp@redhat.com>
+
+       * guniprop.c (g_unichar_isspace): Use a switch here, maybe helps 
+       the compiler optimize things. Also, ' ' is a SPACE_SEPARATOR,
+       so don't special case it.
+
 2000-11-17  Tor Lillqvist  <tml@iki.fi>
 
        * glib.def: Add g_trash_stack entry points.
index c45fc7a..8a1b41d 100644 (file)
@@ -118,15 +118,24 @@ g_unichar_ispunct (gunichar c)
 gboolean
 g_unichar_isspace (gunichar c)
 {
-  /* special-case these since Unicode thinks they are not spaces */
-  if (c == ' ' || c == '\t' || c == '\n' || c == '\r' ||
-      c == '\f' || c == '\v') /* "the mythical vertical tab" */
-    return TRUE;
-  else
+  switch (c)
     {
-      int t = TYPE (c);
-      return (t == G_UNICODE_SPACE_SEPARATOR || t == G_UNICODE_LINE_SEPARATOR
-              || t == G_UNICODE_PARAGRAPH_SEPARATOR);
+      /* special-case these since Unicode thinks they are not spaces */
+    case '\t':
+    case '\n':
+    case '\r':
+    case '\f':
+    case '\v': /* vertical tab - as if anyone has ever used this... */
+      return TRUE;
+      break;
+      
+    default:
+      {
+        int t = TYPE (c);
+        return (t == G_UNICODE_SPACE_SEPARATOR || t == G_UNICODE_LINE_SEPARATOR
+                || t == G_UNICODE_PARAGRAPH_SEPARATOR);
+      }
+      break;
     }
 }
 
index c45fc7a..8a1b41d 100644 (file)
@@ -118,15 +118,24 @@ g_unichar_ispunct (gunichar c)
 gboolean
 g_unichar_isspace (gunichar c)
 {
-  /* special-case these since Unicode thinks they are not spaces */
-  if (c == ' ' || c == '\t' || c == '\n' || c == '\r' ||
-      c == '\f' || c == '\v') /* "the mythical vertical tab" */
-    return TRUE;
-  else
+  switch (c)
     {
-      int t = TYPE (c);
-      return (t == G_UNICODE_SPACE_SEPARATOR || t == G_UNICODE_LINE_SEPARATOR
-              || t == G_UNICODE_PARAGRAPH_SEPARATOR);
+      /* special-case these since Unicode thinks they are not spaces */
+    case '\t':
+    case '\n':
+    case '\r':
+    case '\f':
+    case '\v': /* vertical tab - as if anyone has ever used this... */
+      return TRUE;
+      break;
+      
+    default:
+      {
+        int t = TYPE (c);
+        return (t == G_UNICODE_SPACE_SEPARATOR || t == G_UNICODE_LINE_SEPARATOR
+                || t == G_UNICODE_PARAGRAPH_SEPARATOR);
+      }
+      break;
     }
 }