diff options
Diffstat (limited to 'llvm/lib/TextAPI/MachO/InterfaceFile.cpp')
-rw-r--r-- | llvm/lib/TextAPI/MachO/InterfaceFile.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/TextAPI/MachO/InterfaceFile.cpp b/llvm/lib/TextAPI/MachO/InterfaceFile.cpp index 323f1b61fcd..f1851014e70 100644 --- a/llvm/lib/TextAPI/MachO/InterfaceFile.cpp +++ b/llvm/lib/TextAPI/MachO/InterfaceFile.cpp @@ -21,11 +21,9 @@ namespace MachO { namespace detail { template <typename C> typename C::iterator addEntry(C &Container, StringRef InstallName) { - auto I = - std::lower_bound(std::begin(Container), std::end(Container), InstallName, - [](const InterfaceFileRef &LHS, const StringRef &RHS) { - return LHS.getInstallName() < RHS; - }); + auto I = llvm::bsearch(Container, [=](const InterfaceFileRef &O) { + return InstallName <= O.getInstallName(); + }); if ((I != std::end(Container)) && !(InstallName < I->getInstallName())) return I; @@ -46,11 +44,12 @@ void InterfaceFile::addReexportedLibrary(StringRef InstallName, } void InterfaceFile::addUUID(Architecture Arch, StringRef UUID) { - auto I = std::lower_bound(UUIDs.begin(), UUIDs.end(), Arch, - [](const std::pair<Architecture, std::string> &LHS, - Architecture RHS) { return LHS.first < RHS; }); + auto I = + llvm::bsearch(UUIDs, [=](const std::pair<Architecture, std::string> &O) { + return Arch <= O.first; + }); - if ((I != UUIDs.end()) && !(Arch < I->first)) { + if (I != UUIDs.end() && Arch == I->first) { I->second = UUID; return; } |