summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/ADT/STLExtras.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/ADT/STLExtras.h')
-rw-r--r--llvm/include/llvm/ADT/STLExtras.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 4ce2e9fb72a..81dce0168c7 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -1322,13 +1322,12 @@ void stable_sort(R &&Range, Compare C) {
std::stable_sort(adl_begin(Range), adl_end(Range), C);
}
-/// Binary search for the first iterator in a range where a predicate is true.
-/// Requires that C is always false below some limit, and always true above it.
+/// Binary search for the first iterator in a range where a predicate is false.
+/// Requires that C is always true below some limit, and always false above it.
template <typename R, typename Predicate,
typename Val = decltype(*adl_begin(std::declval<R>()))>
-auto bsearch(R &&Range, Predicate P) -> decltype(adl_begin(Range)) {
- return std::partition_point(adl_begin(Range), adl_end(Range),
- [&](const Val &V) { return !P(V); });
+auto partition_point(R &&Range, Predicate P) -> decltype(adl_begin(Range)) {
+ return std::partition_point(adl_begin(Range), adl_end(Range), P);
}
/// Wrapper function around std::equal to detect if all elements
OpenPOWER on IntegriCloud