[compiler-rt] 3c6c306 - [NFC][sanitizer] Relax InternalLowerBound interface
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 9 12:11:34 PST 2021
Author: Vitaly Buka
Date: 2021-12-09T12:11:24-08:00
New Revision: 3c6c30677ef155000fef4b04abcc48147d687cc2
URL: https://github.com/llvm/llvm-project/commit/3c6c30677ef155000fef4b04abcc48147d687cc2
DIFF: https://github.com/llvm/llvm-project/commit/3c6c30677ef155000fef4b04abcc48147d687cc2.diff
LOG: [NFC][sanitizer] Relax InternalLowerBound interface
val can be of any type accepted by Compare.
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_common.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
index db03a6bc73e0..726974493717 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
@@ -667,11 +667,9 @@ void Sort(T *v, uptr size, Compare comp = {}) {
// Works like std::lower_bound: finds the first element that is not less
// than the val.
-template <class Container,
+template <class Container, class T,
class Compare = CompareLess<typename Container::value_type>>
-uptr InternalLowerBound(const Container &v,
- const typename Container::value_type &val,
- Compare comp = {}) {
+uptr InternalLowerBound(const Container &v, const T &val, Compare comp = {}) {
uptr first = 0;
uptr last = v.size();
while (last > first) {
More information about the llvm-commits
mailing list