[clang-tools-extra] Use llvm::any_of (NFC) (#143281)

This commit is contained in:
Kazu Hirata 2025-06-08 01:34:24 -07:00 committed by GitHub
parent 1cf1c21b84
commit 6edfc6ce6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View File

@ -364,9 +364,8 @@ static json::Value extractValue(const EnumInfo &I,
Object Obj = Object();
std::string EnumType = I.Scoped ? "enum class " : "enum ";
EnumType += I.Name;
bool HasComment = std::any_of(
I.Members.begin(), I.Members.end(),
[](const EnumValueInfo &M) { return !M.Description.empty(); });
bool HasComment = llvm::any_of(
I.Members, [](const EnumValueInfo &M) { return !M.Description.empty(); });
Obj.insert({"EnumName", EnumType});
Obj.insert({"HasComment", HasComment});
Obj.insert({"ID", toHex(toStringRef(I.USR))});

View File

@ -34,8 +34,7 @@ AST_MATCHER(BinaryOperator,
AST_MATCHER(CXXOperatorCallExpr,
hasCppOperatorAChildComparisonOperatorWithoutParen) {
return std::any_of(Node.arg_begin(), Node.arg_end(),
isExprAComparisonOperator);
return llvm::any_of(Node.arguments(), isExprAComparisonOperator);
}
struct ChainedComparisonData {