util/CharUtil: add IsWhitespaceFast()

This commit is contained in:
Max Kellermann
2014-08-07 15:05:27 +02:00
parent 981be7956b
commit db6db51742
5 changed files with 19 additions and 6 deletions

View File

@@ -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)