[AST] Remove isWhitespace in favor of clang::isWhitespace (NFC)

This commit is contained in:
Kazu Hirata 2021-12-11 22:51:59 -08:00
parent 67aeae0138
commit ea68ce2a9b
1 changed files with 3 additions and 11 deletions

View File

@ -8,15 +8,12 @@
#include "clang/AST/CommentBriefParser.h"
#include "clang/AST/CommentCommandTraits.h"
#include "clang/Basic/CharInfo.h"
namespace clang {
namespace comments {
namespace {
inline bool isWhitespace(char C) {
return C == ' ' || C == '\n' || C == '\r' ||
C == '\t' || C == '\f' || C == '\v';
}
/// Convert all whitespace into spaces, remove leading and trailing spaces,
/// compress multiple spaces into one.
@ -26,7 +23,7 @@ void cleanupBrief(std::string &S) {
for (std::string::iterator I = S.begin(), E = S.end();
I != E; ++I) {
const char C = *I;
if (isWhitespace(C)) {
if (clang::isWhitespace(C)) {
if (!PrevWasSpace) {
*O++ = ' ';
PrevWasSpace = true;
@ -44,12 +41,7 @@ void cleanupBrief(std::string &S) {
}
bool isWhitespace(StringRef Text) {
for (StringRef::const_iterator I = Text.begin(), E = Text.end();
I != E; ++I) {
if (!isWhitespace(*I))
return false;
}
return true;
return llvm::all_of(Text, clang::isWhitespace);
}
} // unnamed namespace