aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/str_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'wsutil/str_util.c')
-rw-r--r--wsutil/str_util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/wsutil/str_util.c b/wsutil/str_util.c
index c9dfef8e25..72783f3b91 100644
--- a/wsutil/str_util.c
+++ b/wsutil/str_util.c
@@ -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);
}