From 562e82945eec22679ae20fdb19b84dcd6959bf90 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 12 Aug 2016 00:18:03 +0000 Subject: Use the range variant of find_if instead of unpacking begin/end No functionality change is intended. llvm-svn: 278443 --- llvm/lib/Support/TargetRegistry.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Support/TargetRegistry.cpp') diff --git a/llvm/lib/Support/TargetRegistry.cpp b/llvm/lib/Support/TargetRegistry.cpp index 02a6d334b91..bed9ed64f80 100644 --- a/llvm/lib/Support/TargetRegistry.cpp +++ b/llvm/lib/Support/TargetRegistry.cpp @@ -30,8 +30,7 @@ const Target *TargetRegistry::lookupTarget(const std::string &ArchName, // name, because it might be a backend that has no mapping to a target triple. const Target *TheTarget = nullptr; if (!ArchName.empty()) { - auto I = - std::find_if(targets().begin(), targets().end(), + auto I = find_if(targets(), [&](const Target &T) { return ArchName == T.getName(); }); if (I == targets().end()) { @@ -70,7 +69,7 @@ const Target *TargetRegistry::lookupTarget(const std::string &TT, } Triple::ArchType Arch = Triple(TT).getArch(); auto ArchMatch = [&](const Target &T) { return T.ArchMatchFn(Arch); }; - auto I = std::find_if(targets().begin(), targets().end(), ArchMatch); + auto I = find_if(targets(), ArchMatch); if (I == targets().end()) { Error = "No available targets are compatible with this triple."; -- cgit v1.2.3