aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/CharUtil.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-07 15:05:27 +0200
committerMax Kellermann <max@duempel.org>2014-08-07 16:08:02 +0200
commitdb6db517424e09bab9a12934e9df6807a7049926 (patch)
tree6525302356ec79acb6bebd179a13b760b8dcb279 /src/util/CharUtil.hxx
parent981be7956b86c4bcf449ff87082f422721a6e8c3 (diff)
downloadmpd-db6db517424e09bab9a12934e9df6807a7049926.tar.gz
mpd-db6db517424e09bab9a12934e9df6807a7049926.tar.xz
mpd-db6db517424e09bab9a12934e9df6807a7049926.zip
util/CharUtil: add IsWhitespaceFast()
Diffstat (limited to '')
-rw-r--r--src/util/CharUtil.hxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util/CharUtil.hxx b/src/util/CharUtil.hxx
index 3c1959b22..9cb852524 100644
--- a/src/util/CharUtil.hxx
+++ b/src/util/CharUtil.hxx
@@ -58,6 +58,19 @@ IsWhitespaceNotNull(const char ch)
return ch > 0 && ch <= 0x20;
}
+/**
+ * Is the given character whitespace? This calls the faster one of
+ * IsWhitespaceOrNull() or IsWhitespaceNotNull(). Use this if you
+ * want the fastest implementation, and you don't care if a null byte
+ * matches.
+ */
+constexpr
+static inline bool
+IsWhitespaceFast(const char ch)
+{
+ return IsWhitespaceOrNull(ch);
+}
+
constexpr
static inline bool
IsPrintableASCII(char ch)