[clang-tools-extra] [clang-tidy][NFC] Enable readability-any-all-of check (PR #167134)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 8 04:33:05 PST 2025


================
@@ -136,11 +136,9 @@ getRepresentation(const std::vector<llvm::StringRef> &Config,
 template <typename T>
 static bool isAnyOperatorEnabled(const std::vector<llvm::StringRef> &Config,
                                  const T &Operators) {
-  for (const auto &[traditional, alternative] : Operators) {
-    if (!getRepresentation(Config, traditional, alternative).empty())
-      return true;
-  }
-  return false;
+  return llvm::any_of(Operators, [&](const auto &Op) {
+    return !getRepresentation(Config, Op.first, Op.second).empty();
+  });
----------------
vbvictor wrote:

Arguably less readability than `for (const auto &[traditional, alternative] : Operators)`

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


More information about the cfe-commits mailing list