diff options
author | Kazu Hirata <kazu@google.com> | 2025-06-26 08:41:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-26 08:41:10 -0700 |
commit | 31122446c90eb6cca1e1f4e70722d0b9277ccdb7 (patch) | |
tree | 41f927ba71b1e37123b119652f67b4af55414cfb /clang/lib/Basic | |
parent | 70dce3d987ce3c8477552aa9ec67e5c8b6bd5da0 (diff) | |
download | llvm-31122446c90eb6cca1e1f4e70722d0b9277ccdb7.zip llvm-31122446c90eb6cca1e1f4e70722d0b9277ccdb7.tar.gz llvm-31122446c90eb6cca1e1f4e70722d0b9277ccdb7.tar.bz2 |
[clang] Use llvm::is_contained instead of llvm::all_of (NFC) (#145843)
llvm::is_contained is shorter than llvm::all_of plus a lambda.
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r-- | clang/lib/Basic/Attributes.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Basic/Attributes.cpp b/clang/lib/Basic/Attributes.cpp index 004e520..81b186f 100644 --- a/clang/lib/Basic/Attributes.cpp +++ b/clang/lib/Basic/Attributes.cpp @@ -260,8 +260,7 @@ static constexpr const char *AttrScopeSpellingList[] = { std::optional<StringRef> AttributeCommonInfo::tryGetCorrectedScopeName(StringRef ScopeName) const { if (ScopeName.size() > 0 && - llvm::none_of(AttrScopeSpellingList, - [&](const char *S) { return S == ScopeName; })) { + !llvm::is_contained(AttrScopeSpellingList, ScopeName)) { SimpleTypoCorrection STC(ScopeName); for (const auto &Scope : AttrScopeSpellingList) STC.add(Scope); @@ -275,8 +274,7 @@ AttributeCommonInfo::tryGetCorrectedScopeName(StringRef ScopeName) const { std::optional<StringRef> AttributeCommonInfo::tryGetCorrectedAttrName( StringRef ScopeName, StringRef AttrName, const TargetInfo &Target, const LangOptions &LangOpts) const { - if (llvm::none_of(AttrSpellingList, - [&](const char *A) { return A == AttrName; })) { + if (!llvm::is_contained(AttrSpellingList, AttrName)) { SimpleTypoCorrection STC(AttrName); for (const auto &Attr : AttrSpellingList) STC.add(Attr); |