From 5462f34ed037111d2d57638352b2f1a65a322579 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 23 Dec 2010 16:16:01 +0100 Subject: string_util: add function strchug_fast() Replace g_strchug() calls with a cheaper implementation. --- src/string_util.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/string_util.c') diff --git a/src/string_util.c b/src/string_util.c index b93292854..3ae759917 100644 --- a/src/string_util.c +++ b/src/string_util.c @@ -24,6 +24,15 @@ #include +const char * +strchug_fast_c(const char *p) +{ + while (*p != 0 && g_ascii_isspace(*p)) + ++p; + + return p; +} + bool string_array_contains(const char *const* haystack, const char *needle) { -- cgit v1.2.3