Use a switch here, maybe helps the compiler optimize things. Also, ' ' is

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.
This commit is contained in:
Havoc Pennington 2000-11-20 15:14:14 +00:00 committed by Havoc Pennington
parent b24f1d179e
commit 399ad0b8b0
10 changed files with 82 additions and 16 deletions

View 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.

View 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.

View 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.

View 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.

View 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.

View 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.

View 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.

View 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.

View 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;
}
}

View 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;
}
}