[libcxx-commits] [libcxx] [libc++][ranges] optimize the performance of `ranges::starts_with` (PR #84570)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 26 07:49:11 PDT 2024


================
@@ -50,14 +54,36 @@ struct __fn {
       _Pred __pred   = {},
       _Proj1 __proj1 = {},
       _Proj2 __proj2 = {}) {
-    return __mismatch::__fn::__go(
+    if constexpr (sized_sentinel_for<_Sent1, _Iter1> && sized_sentinel_for<_Sent2, _Iter2>) {
----------------
ldionne wrote:

Can you confirm that we already have test coverage for these new branches being introduced? Do we check with the appropriate types of sentinels and iterators already in our tests?

https://github.com/llvm/llvm-project/pull/84570


More information about the libcxx-commits mailing list