In ascii_xx_inplace use g_ascii_isupper/g_ascii_islower directly, it

*should* be slightly more efficient.

Change-Id: I3081e2e25f241cdb07fa46011f50709fd560fb1c
Reviewed-on: https://code.wireshark.org/review/1626
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
AndersBroman 2014-05-13 18:00:25 +02:00 committed by Anders Broman
parent cd8188ddb8
commit f7819de76a
1 changed files with 4 additions and 2 deletions

View File

@ -58,7 +58,8 @@ ascii_strdown_inplace(gchar *str)
gchar *s;
for (s = str; *s; s++)
*s = g_ascii_tolower (*s);
/* What 'g_ascii_tolower (gchar c)' does, this should be slightly more efficient */
*s = g_ascii_isupper (*s) ? *s - 'A' + 'a' : *s;
return (str);
}
@ -70,7 +71,8 @@ ascii_strup_inplace(gchar *str)
gchar *s;
for (s = str; *s; s++)
*s = g_ascii_toupper (*s);
/* What 'g_ascii_toupper (gchar c)' does, this should be slightly more efficient */
*s = g_ascii_islower (*s) ? *s - 'a' + 'A' : *s;
return (str);
}