Use memset; might be faster if someone used this for a biiig string.

Wed Sep 26 11:00:31 2001  Owen Taylor  <otaylor@redhat.com>

	* glib/gstrfuncs.c (g_strnfill): Use memset; might be
	faster if someone used this for a biiig string.
	(Suggestion from Jakub Jelinek)
This commit is contained in:
Owen Taylor 2001-09-26 15:26:44 +00:00 committed by Owen Taylor
parent 0208965f0f
commit 44dfc68e30
9 changed files with 51 additions and 6 deletions

View File

@ -1,3 +1,9 @@
Wed Sep 26 11:00:31 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strnfill): Use memset; might be
faster if someone used this for a biiig string.
(Suggestion from Jakub Jelinek)
2001-09-26 Tor Lillqvist <tml@iki.fi> 2001-09-26 Tor Lillqvist <tml@iki.fi>
* configure.in: (Win32:) Move the Win32 check closer to the start, * configure.in: (Win32:) Move the Win32 check closer to the start,

View File

@ -1,3 +1,9 @@
Wed Sep 26 11:00:31 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strnfill): Use memset; might be
faster if someone used this for a biiig string.
(Suggestion from Jakub Jelinek)
2001-09-26 Tor Lillqvist <tml@iki.fi> 2001-09-26 Tor Lillqvist <tml@iki.fi>
* configure.in: (Win32:) Move the Win32 check closer to the start, * configure.in: (Win32:) Move the Win32 check closer to the start,

View File

@ -1,3 +1,9 @@
Wed Sep 26 11:00:31 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strnfill): Use memset; might be
faster if someone used this for a biiig string.
(Suggestion from Jakub Jelinek)
2001-09-26 Tor Lillqvist <tml@iki.fi> 2001-09-26 Tor Lillqvist <tml@iki.fi>
* configure.in: (Win32:) Move the Win32 check closer to the start, * configure.in: (Win32:) Move the Win32 check closer to the start,

View File

@ -1,3 +1,9 @@
Wed Sep 26 11:00:31 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strnfill): Use memset; might be
faster if someone used this for a biiig string.
(Suggestion from Jakub Jelinek)
2001-09-26 Tor Lillqvist <tml@iki.fi> 2001-09-26 Tor Lillqvist <tml@iki.fi>
* configure.in: (Win32:) Move the Win32 check closer to the start, * configure.in: (Win32:) Move the Win32 check closer to the start,

View File

@ -1,3 +1,9 @@
Wed Sep 26 11:00:31 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strnfill): Use memset; might be
faster if someone used this for a biiig string.
(Suggestion from Jakub Jelinek)
2001-09-26 Tor Lillqvist <tml@iki.fi> 2001-09-26 Tor Lillqvist <tml@iki.fi>
* configure.in: (Win32:) Move the Win32 check closer to the start, * configure.in: (Win32:) Move the Win32 check closer to the start,

View File

@ -1,3 +1,9 @@
Wed Sep 26 11:00:31 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strnfill): Use memset; might be
faster if someone used this for a biiig string.
(Suggestion from Jakub Jelinek)
2001-09-26 Tor Lillqvist <tml@iki.fi> 2001-09-26 Tor Lillqvist <tml@iki.fi>
* configure.in: (Win32:) Move the Win32 check closer to the start, * configure.in: (Win32:) Move the Win32 check closer to the start,

View File

@ -1,3 +1,9 @@
Wed Sep 26 11:00:31 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strnfill): Use memset; might be
faster if someone used this for a biiig string.
(Suggestion from Jakub Jelinek)
2001-09-26 Tor Lillqvist <tml@iki.fi> 2001-09-26 Tor Lillqvist <tml@iki.fi>
* configure.in: (Win32:) Move the Win32 check closer to the start, * configure.in: (Win32:) Move the Win32 check closer to the start,

View File

@ -1,3 +1,9 @@
Wed Sep 26 11:00:31 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strnfill): Use memset; might be
faster if someone used this for a biiig string.
(Suggestion from Jakub Jelinek)
2001-09-26 Tor Lillqvist <tml@iki.fi> 2001-09-26 Tor Lillqvist <tml@iki.fi>
* configure.in: (Win32:) Move the Win32 check closer to the start, * configure.in: (Win32:) Move the Win32 check closer to the start,

View File

@ -133,14 +133,11 @@ gchar*
g_strnfill (gsize length, g_strnfill (gsize length,
gchar fill_char) gchar fill_char)
{ {
register gchar *str, *s, *end; gchar *str;
str = g_new (gchar, length + 1); str = g_new (gchar, length + 1);
s = str; memset (str, (guchar)fill_char, length);
end = str + length; str[length] = '\0';
while (s < end)
*(s++) = fill_char;
*s = 0;
return str; return str;
} }