aboutsummaryrefslogtreecommitdiffstats
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)
downloadmpd-5462f34ed037111d2d57638352b2f1a65a322579.tar.gz
mpd-5462f34ed037111d2d57638352b2f1a65a322579.tar.xz
mpd-5462f34ed037111d2d57638352b2f1a65a322579.zip
string_util: add function strchug_fast()
Replace g_strchug() calls with a cheaper implementation.
Diffstat (limited to '')
-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 b93292854..3ae759917 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)
{