[clang] [NFC][clang] replace a C-array with std::array (PR #158047)

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 11 04:54:12 PDT 2025


================
@@ -5211,11 +5211,7 @@ class SpellingList {
   }
 
   bool hasSpelling() const {
-    for (size_t Kind = 0; Kind < NumSpellingKinds; ++Kind) {
-      if (Spellings[Kind].size() > 0)
-        return true;
-    }
-    return false;
+    return llvm::any_of(Spellings, [](const auto &L) { return L.size() != 0; });
----------------
philnik777 wrote:

```suggestion
    return llvm::any_of(Spellings, [](const auto &L) { return !L.empty(); });
```

https://github.com/llvm/llvm-project/pull/158047


More information about the cfe-commits mailing list