summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TextAPI/MachO/InterfaceFile.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-06-30 11:19:56 +0000
committerFangrui Song <maskray@google.com>2019-06-30 11:19:56 +0000
commit78ee2fbf984b84db814bf7b3a68e2317e32b1a24 (patch)
tree83fad2d809aa8d625b95a949b0d36ef9ceeaa2e4 /llvm/lib/TextAPI/MachO/InterfaceFile.cpp
parent2d2cb77e45d4c9ca34d05f80430e0f9404252980 (diff)
downloadbcm5719-llvm-78ee2fbf984b84db814bf7b3a68e2317e32b1a24.tar.gz
bcm5719-llvm-78ee2fbf984b84db814bf7b3a68e2317e32b1a24.zip
Cleanup: llvm::bsearch -> llvm::partition_point after r364719
llvm-svn: 364720
Diffstat (limited to 'llvm/lib/TextAPI/MachO/InterfaceFile.cpp')
-rw-r--r--llvm/lib/TextAPI/MachO/InterfaceFile.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/TextAPI/MachO/InterfaceFile.cpp b/llvm/lib/TextAPI/MachO/InterfaceFile.cpp
index f1851014e70..54ba8cc3126 100644
--- a/llvm/lib/TextAPI/MachO/InterfaceFile.cpp
+++ b/llvm/lib/TextAPI/MachO/InterfaceFile.cpp
@@ -14,17 +14,15 @@
#include <iomanip>
#include <sstream>
-using namespace llvm::MachO;
-
namespace llvm {
namespace MachO {
namespace detail {
template <typename C>
typename C::iterator addEntry(C &Container, StringRef InstallName) {
- auto I = llvm::bsearch(Container, [=](const InterfaceFileRef &O) {
- return InstallName <= O.getInstallName();
+ auto I = partition_point(Container, [=](const InterfaceFileRef &O) {
+ return O.getInstallName() < InstallName;
});
- if ((I != std::end(Container)) && !(InstallName < I->getInstallName()))
+ if (I != Container.end() && I->getInstallName() == InstallName)
return I;
return Container.emplace(I, InstallName);
@@ -44,10 +42,10 @@ void InterfaceFile::addReexportedLibrary(StringRef InstallName,
}
void InterfaceFile::addUUID(Architecture Arch, StringRef UUID) {
- auto I =
- llvm::bsearch(UUIDs, [=](const std::pair<Architecture, std::string> &O) {
- return Arch <= O.first;
- });
+ auto I = partition_point(UUIDs,
+ [=](const std::pair<Architecture, std::string> &O) {
+ return O.first < Arch;
+ });
if (I != UUIDs.end() && Arch == I->first) {
I->second = UUID;
OpenPOWER on IntegriCloud