[libcxx-commits] [libcxx] [libc++] Optimize search_n (PR #171389)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Dec 10 07:39:33 PST 2025
================
@@ -119,7 +113,7 @@ template <class _Iter,
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_Iter, _Iter>
__search_n_impl(_Iter __first, _Sent __last, _DiffT __count, const _Type& __value, _Pred& __pred, _Proj& __proj) {
return std::__search_n_random_access_impl<_ClassicAlgPolicy>(
- __first, __last, __count, __value, __pred, __proj, __last - __first);
+ __first, __count, __value, __pred, __proj, __last - __first);
}
----------------
ldionne wrote:
Not attached to this line: Let's add test coverage for having multiple subranges that partially match within a sequence. You can take inspiration from `ranges::search_n` for the corner cases that are covered.
https://github.com/llvm/llvm-project/pull/171389
More information about the libcxx-commits
mailing list