aboutsummaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-07 14:53:07 +0200
committerMax Kellermann <max@duempel.org>2014-08-07 16:08:02 +0200
commit87bcf739ee6a3e8ac5b400b35b61b72b9d8bd802 (patch)
tree9f2170889dfbfff90816d7d4eea7b19373ba213f /src/util
parentdb6db517424e09bab9a12934e9df6807a7049926 (diff)
downloadmpd-87bcf739ee6a3e8ac5b400b35b61b72b9d8bd802.tar.gz
mpd-87bcf739ee6a3e8ac5b400b35b61b72b9d8bd802.tar.xz
mpd-87bcf739ee6a3e8ac5b400b35b61b72b9d8bd802.zip
util/StringUtil: rename strchug_fast() to StripLeft()
Diffstat (limited to 'src/util')
-rw-r--r--src/util/StringUtil.cxx4
-rw-r--r--src/util/StringUtil.hxx9
-rw-r--r--src/util/Tokenizer.cxx6
3 files changed, 8 insertions, 11 deletions
diff --git a/src/util/StringUtil.cxx b/src/util/StringUtil.cxx
index 50885a34a..153846e9b 100644
--- a/src/util/StringUtil.cxx
+++ b/src/util/StringUtil.cxx
@@ -27,7 +27,7 @@
#include <string.h>
const char *
-strchug_fast(const char *p)
+StripLeft(const char *p)
{
while (IsWhitespaceNotNull(*p))
++p;
@@ -38,7 +38,7 @@ strchug_fast(const char *p)
char *
Strip(char *p)
{
- p = strchug_fast(p);
+ p = StripLeft(p);
size_t length = strlen(p);
while (length > 0 && IsWhitespaceNotNull(p[length - 1]))
diff --git a/src/util/StringUtil.hxx b/src/util/StringUtil.hxx
index e8e3b2b5d..6bccbeffe 100644
--- a/src/util/StringUtil.hxx
+++ b/src/util/StringUtil.hxx
@@ -27,19 +27,16 @@
/**
* Returns a pointer to the first non-whitespace character in the
* string, or to the end of the string.
- *
- * This is a faster version of g_strchug(), because it does not move
- * data.
*/
gcc_pure
const char *
-strchug_fast(const char *p);
+StripLeft(const char *p);
gcc_pure
static inline char *
-strchug_fast(char *p)
+StripLeft(char *p)
{
- return const_cast<char *>(strchug_fast((const char *)p));
+ return const_cast<char *>(StripLeft((const char *)p));
}
/**
diff --git a/src/util/Tokenizer.cxx b/src/util/Tokenizer.cxx
index 306a90074..19322b70d 100644
--- a/src/util/Tokenizer.cxx
+++ b/src/util/Tokenizer.cxx
@@ -71,7 +71,7 @@ Tokenizer::NextWord(Error &error)
/* a whitespace: the word ends here */
*input = 0;
/* skip all following spaces, too */
- input = strchug_fast(input + 1);
+ input = StripLeft(input + 1);
break;
}
@@ -116,7 +116,7 @@ Tokenizer::NextUnquoted(Error &error)
/* a whitespace: the word ends here */
*input = 0;
/* skip all following spaces, too */
- input = strchug_fast(input + 1);
+ input = StripLeft(input + 1);
break;
}
@@ -185,7 +185,7 @@ Tokenizer::NextString(Error &error)
/* finish the string and return it */
*dest = 0;
- input = strchug_fast(input);
+ input = StripLeft(input);
return word;
}