[llvm] e4f63cd - [llvm] Use is_contained (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 29 21:19:02 PDT 2022
Author: Kazu Hirata
Date: 2022-07-29T21:18:44-07:00
New Revision: e4f63cd0f73391d86a92c1e681a9e56ac717df5a
URL: https://github.com/llvm/llvm-project/commit/e4f63cd0f73391d86a92c1e681a9e56ac717df5a
DIFF: https://github.com/llvm/llvm-project/commit/e4f63cd0f73391d86a92c1e681a9e56ac717df5a.diff
LOG: [llvm] Use is_contained (NFC)
Added:
Modified:
llvm/tools/llvm-tapi-diff/DiffEngine.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-tapi-
diff /DiffEngine.cpp b/llvm/tools/llvm-tapi-
diff /DiffEngine.cpp
index 45a1f78525a74..20f1dbc7fd7f4 100644
--- a/llvm/tools/llvm-tapi-
diff /DiffEngine.cpp
+++ b/llvm/tools/llvm-tapi-
diff /DiffEngine.cpp
@@ -236,9 +236,8 @@ void findAndAddDiff(const std::vector<InterfaceFileRef> &CollectedIRefVec,
for (const auto &IRef : CollectedIRefVec)
for (auto Targ : IRef.targets()) {
auto FoundIRef = llvm::find_if(LookupIRefVec, [&](const auto LIRef) {
- auto FoundTarg = llvm::find(LIRef.targets(), Targ);
- return (FoundTarg != LIRef.targets().end() &&
- IRef.getInstallName() == LIRef.getInstallName());
+ return llvm::is_contained(LIRef.targets(), Targ) &&
+ IRef.getInstallName() == LIRef.getInstallName();
});
if (FoundIRef == LookupIRefVec.end())
addDiffForTargSlice<DiffStrVec,
@@ -268,11 +267,10 @@ void findAndAddDiff(InterfaceFile::const_symbol_range CollectedSyms,
for (const auto *Sym : CollectedSyms)
for (const auto Targ : Sym->targets()) {
auto FoundSym = llvm::find_if(LookupSyms, [&](const auto LSym) {
- auto FoundTarg = llvm::find(LSym->targets(), Targ);
- return (Sym->getName() == LSym->getName() &&
- Sym->getKind() == LSym->getKind() &&
- Sym->getFlags() == LSym->getFlags() &&
- FoundTarg != LSym->targets().end());
+ return Sym->getName() == LSym->getName() &&
+ Sym->getKind() == LSym->getKind() &&
+ Sym->getFlags() == LSym->getFlags() &&
+ llvm::is_contained(LSym->targets(), Targ);
});
if (FoundSym == LookupSyms.end())
addDiffForTargSlice<DiffSymVec, SymScalar>(Sym, Targ, Result, Order);
More information about the llvm-commits
mailing list