aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2025-07-10 18:07:17 -0700
committerGitHub <noreply@github.com>2025-07-10 18:07:17 -0700
commit7704f817d0a60596c4c8883c8a8ece67f0a8255a (patch)
tree13c13688b6d3c2d8e26cd7b3e6edf584c9310dd9 /clang/lib/Format
parent34a1daae8390184a7f7072c49a5f47ce24287d59 (diff)
downloadllvm-7704f817d0a60596c4c8883c8a8ece67f0a8255a.zip
llvm-7704f817d0a60596c4c8883c8a8ece67f0a8255a.tar.gz
llvm-7704f817d0a60596c4c8883c8a8ece67f0a8255a.tar.bz2
[clang-format][NFC] Replace a function with StringRef::contains (#146245)
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/BreakableToken.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/clang/lib/Format/BreakableToken.cpp b/clang/lib/Format/BreakableToken.cpp
index def0d73..24912c2 100644
--- a/clang/lib/Format/BreakableToken.cpp
+++ b/clang/lib/Format/BreakableToken.cpp
@@ -26,18 +26,6 @@ namespace clang {
namespace format {
static constexpr StringRef Blanks = " \t\v\f\r";
-static bool IsBlank(char C) {
- switch (C) {
- case ' ':
- case '\t':
- case '\v':
- case '\f':
- case '\r':
- return true;
- default:
- return false;
- }
-}
static StringRef getLineCommentIndentPrefix(StringRef Comment,
const FormatStyle &Style) {
@@ -193,7 +181,7 @@ getStringSplit(StringRef Text, unsigned UsedColumns, unsigned ColumnLimit,
if (Chars > MaxSplit || Text.size() <= Advance)
break;
- if (IsBlank(Text[0]))
+ if (Blanks.contains(Text[0]))
SpaceOffset = SplitPoint;
if (Text[0] == '/')
SlashOffset = SplitPoint;