Skip to content

Commit 60fbefc

Browse files
committed
Use constexpr std::array for QtPropertyKeywords and CppNonKeywordTypes
1 parent 813bbca commit 60fbefc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Format/FormatToken.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const char *getTokenTypeName(TokenType Type) {
3333
return nullptr;
3434
}
3535

36-
static SmallVector<StringRef> QtPropertyKeywords = {
36+
static constexpr std::array<StringRef, 14> QtPropertyKeywords = {
3737
"BINDABLE", "CONSTANT", "DESIGNABLE", "FINAL", "MEMBER",
3838
"NOTIFY", "READ", "REQUIRED", "RESET", "REVISION",
3939
"SCRIPTABLE", "STORED", "USER", "WRITE",
@@ -46,7 +46,7 @@ bool FormatToken::isQtProperty() const {
4646
}
4747

4848
// Sorted common C++ non-keyword types.
49-
static SmallVector<StringRef> CppNonKeywordTypes = {
49+
static constexpr std::array<StringRef, 14> CppNonKeywordTypes = {
5050
"clock_t", "int16_t", "int32_t", "int64_t", "int8_t",
5151
"intptr_t", "ptrdiff_t", "size_t", "time_t", "uint16_t",
5252
"uint32_t", "uint64_t", "uint8_t", "uintptr_t",

0 commit comments

Comments
 (0)