Skip to content

Commit 6cb2887

Browse files
[clang-format] [NFC] Use some constexpr StringRef
Instead of const char*. Differential Revision: https://reviews.llvm.org/D95078
1 parent 53176c1 commit 6cb2887

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clang/lib/Format/BreakableToken.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
namespace clang {
2626
namespace format {
2727

28-
static const char *const Blanks = " \t\v\f\r";
28+
static constexpr StringRef Blanks = " \t\v\f\r";
2929
static bool IsBlank(char C) {
3030
switch (C) {
3131
case ' ':
@@ -41,11 +41,11 @@ static bool IsBlank(char C) {
4141

4242
static StringRef getLineCommentIndentPrefix(StringRef Comment,
4343
const FormatStyle &Style) {
44-
static const char *const KnownCStylePrefixes[] = {"///<", "//!<", "///",
45-
"//", "//!", "//:"};
46-
static const char *const KnownTextProtoPrefixes[] = {"//", "#", "##", "###",
47-
"####"};
48-
ArrayRef<const char *> KnownPrefixes(KnownCStylePrefixes);
44+
static constexpr StringRef KnownCStylePrefixes[] = {"///<", "//!<", "///",
45+
"//", "//!", "//:"};
46+
static constexpr StringRef KnownTextProtoPrefixes[] = {"//", "#", "##", "###",
47+
"####"};
48+
ArrayRef<StringRef> KnownPrefixes(KnownCStylePrefixes);
4949
if (Style.Language == FormatStyle::LK_TextProto)
5050
KnownPrefixes = KnownTextProtoPrefixes;
5151

0 commit comments

Comments
 (0)