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

Xiaoyang Liu via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 26 09:00:09 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>) {
----------------
xiaoyang-sde wrote:

I manually inserted `return false` in each branch and verified that all branches are covered. Do we have a code coverage generator for `libc++` test cases?

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


More information about the libcxx-commits mailing list