@@ -2948,7 +2948,8 @@ __pattern_remove_if(__parallel_tag<_IsVector> __tag, _ExecutionPolicy&& __exec,
2948
2948
// ------------------------------------------------------------------------
2949
2949
// merge
2950
2950
// ------------------------------------------------------------------------
2951
-
2951
+ // Serial version of ___merge_path_out_lim merges 1st sequience and 2nd sequience in "revert maner":
2952
+ // the identical elements from 2nd sequience are being merged first.
2952
2953
template <typename _Iterator1, typename _Iterator2, typename _Iterator3, typename _Comp>
2953
2954
std::pair<_Iterator1, _Iterator2>
2954
2955
__serial_merge_out_lim (_Iterator1 __x, _Iterator1 __x_e, _Iterator2 __y, _Iterator2 __y_e, _Iterator3 __i,
@@ -3020,10 +3021,7 @@ std::pair<_It1, _It2>
3020
3021
___merge_path_out_lim (_Tag, _ExecutionPolicy&& __exec, _It1 __it_1, _Index1 __n_1, _It2 __it_2, _Index2 __n_2,
3021
3022
_OutIt __it_out, _Index3 __n_out, _Comp __comp)
3022
3023
{
3023
- // ___merge_path_out_lim is called with reverse order: (2nd sequience, 1st sequience)
3024
- // __serial_merge_out_lim does merging in direct order: (1st sequience and 2nd sequience).
3025
- // So, the following call passes 1st sequience 2nd sequience in "a revert maner".
3026
- return __serial_merge_out_lim (__it_2, __it_2 + __n_2, __it_1, __it_1 + __n_1, __it_out, __it_out + __n_out, __comp);
3024
+ return __serial_merge_out_lim (__it_1, __it_1 + __n_1, __it_2, __it_2 + __n_2, __it_out, __it_out + __n_out, __comp);
3027
3025
}
3028
3026
3029
3027
inline constexpr std::size_t __merge_path_cut_off = 2000 ;
0 commit comments