Skip to content

Commit 7704f81

Browse files
authored
[clang-format][NFC] Replace a function with StringRef::contains (#146245)
1 parent 34a1daa commit 7704f81

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

clang/lib/Format/BreakableToken.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,6 @@ namespace clang {
2626
namespace format {
2727

2828
static constexpr StringRef Blanks = " \t\v\f\r";
29-
static bool IsBlank(char C) {
30-
switch (C) {
31-
case ' ':
32-
case '\t':
33-
case '\v':
34-
case '\f':
35-
case '\r':
36-
return true;
37-
default:
38-
return false;
39-
}
40-
}
4129

4230
static StringRef getLineCommentIndentPrefix(StringRef Comment,
4331
const FormatStyle &Style) {
@@ -193,7 +181,7 @@ getStringSplit(StringRef Text, unsigned UsedColumns, unsigned ColumnLimit,
193181
if (Chars > MaxSplit || Text.size() <= Advance)
194182
break;
195183

196-
if (IsBlank(Text[0]))
184+
if (Blanks.contains(Text[0]))
197185
SpaceOffset = SplitPoint;
198186
if (Text[0] == '/')
199187
SlashOffset = SplitPoint;

0 commit comments

Comments
 (0)