aboutsummaryrefslogtreecommitdiff
path: root/src/string_util.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-12-23 16:16:01 +0100
committerMax Kellermann <max@duempel.org>2010-12-23 16:23:20 +0100
commit5462f34ed037111d2d57638352b2f1a65a322579 (patch)
treed1acf3493d2d8edbbda9ae77a327d26ae249f3f9 /src/string_util.c
parent0958ed584431ac09e676dd51925e56142416e7c2 (diff)
string_util: add function strchug_fast()
Replace g_strchug() calls with a cheaper implementation.
Diffstat (limited to 'src/string_util.c')
-rw-r--r--src/string_util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/string_util.c b/src/string_util.c
index b9329285..3ae75991 100644
--- a/src/string_util.c
+++ b/src/string_util.c
@@ -24,6 +24,15 @@
#include <assert.h>
+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)
{