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

@@ -67,7 +67,7 @@ Tokenizer::NextWord(Error &error)
whitespace or end-of-string */
while (*++input != 0) {
if (IsWhitespaceOrNull(*input)) {
if (IsWhitespaceFast(*input)) {
/* a whitespace: the word ends here */
*input = 0;
/* skip all following spaces, too */
@@ -112,7 +112,7 @@ Tokenizer::NextUnquoted(Error &error)
whitespace or end-of-string */
while (*++input != 0) {
if (IsWhitespaceOrNull(*input)) {
if (IsWhitespaceFast(*input)) {
/* a whitespace: the word ends here */
*input = 0;
/* skip all following spaces, too */
@@ -176,7 +176,7 @@ Tokenizer::NextString(Error &error)
line) */
++input;
if (!IsWhitespaceOrNull(*input)) {
if (!IsWhitespaceFast(*input)) {
error.Set(tokenizer_domain,
"Space expected after closing '\"'");
return nullptr;