Skip to content

Commit 64d5e6c

Browse files
Keenutsphilnik777
andauthored
[NFC][clang] replace a C-array with std::array (#158047)
Follow up to #157841, replacing the C-array with std::array so iterators can be used. --------- Co-authored-by: Nikolas Klauser <[email protected]>
1 parent 00c0510 commit 64d5e6c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

clang/utils/TableGen/ClangAttrEmitter.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5169,7 +5169,7 @@ enum class SpellingKind : size_t {
51695169
static const size_t NumSpellingKinds = (size_t)SpellingKind::NumSpellingKinds;
51705170

51715171
class SpellingList {
5172-
std::vector<std::string> Spellings[NumSpellingKinds];
5172+
std::array<std::vector<std::string>, NumSpellingKinds> Spellings;
51735173

51745174
public:
51755175
ArrayRef<std::string> operator[](SpellingKind K) const {
@@ -5217,11 +5217,7 @@ class SpellingList {
52175217
}
52185218

52195219
bool hasSpelling() const {
5220-
for (size_t Kind = 0; Kind < NumSpellingKinds; ++Kind) {
5221-
if (Spellings[Kind].size() > 0)
5222-
return true;
5223-
}
5224-
return false;
5220+
return llvm::any_of(Spellings, [](const auto &L) { return !L.empty(); });
52255221
}
52265222
};
52275223

0 commit comments

Comments
 (0)