Skip to content

Commit f039f4b

Browse files
committed
Improve formatting and comments
1 parent 57763ff commit f039f4b

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ struct __contains_fn
410410
bool
411411
operator()(_ExecutionPolicy&& __exec, _R&& __r, const _T& __value, _Proj __proj = {}) const
412412
{
413-
// To ensure no dangling pointer is returned, __r may not be forwarded
413+
// To ensure no dangling iterator is returned, __r may not be forwarded
414414
return oneapi::dpl::ranges::find(std::forward<_ExecutionPolicy>(__exec), __r, __value, __proj)
415415
!= std::ranges::end(__r);
416416
}
@@ -429,8 +429,8 @@ struct __contains_subrange_fn
429429
_Proj2 __proj2 = {}) const
430430
{
431431
// To ensure no dangling subrange is returned, __r1 may not be forwarded
432-
return __r2.size() == 0 || ! oneapi::dpl::ranges::search(std::forward<_ExecutionPolicy>(__exec), __r1, __r2,
433-
__pred, __proj1, __proj2).empty();
432+
return __r2.size() == 0 || !(oneapi::dpl::ranges::search(std::forward<_ExecutionPolicy>(__exec), __r1, __r2,
433+
__pred, __proj1, __proj2).empty());
434434
}
435435
}; // __contains_subrange_fn
436436
} // __internal

test/parallel_api/ranges/std_ranges_contains_subrange.pass.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
auto checker = TEST_PREPARE_CALLABLE(std::ranges::contains_subrange);
1818
#else
1919
struct {
20-
2120
template<std::ranges::forward_range R1, std::ranges::forward_range R2, typename Pred = std::ranges::equal_to,
2221
typename Proj1 = std::identity, typename Proj2 = std::identity>
2322
bool operator()(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {})
@@ -38,10 +37,10 @@ main()
3837
using namespace test_std_ranges;
3938
namespace dpl_ranges = oneapi::dpl::ranges;
4039

41-
auto lam = [](auto i) { return i + 371; };
42-
using data_gen_shifted = decltype(lam);
40+
auto shift = [](auto i) { return i + 371; };
41+
using data_gen_shifted = decltype(shift);
4342

44-
// Sizes of both sequences will vary in the test, so each call might test both successful and unsuccessful searches
43+
// Sizes of both sequences vary in the test, so each call might test both successful and unsuccessful searches
4544
launcher<0, int>{big_sz}(dpl_ranges::contains_subrange, checker, binary_pred_const);
4645
launcher<1, int>{}(dpl_ranges::contains_subrange, checker);
4746
launcher<2, int>{}(dpl_ranges::contains_subrange, checker, binary_pred, dpl::identity{});

0 commit comments

Comments
 (0)