[pstl] Use logical operator for loop condition in tests

Fix a probable typo in two PSTL tests that causes warnings with GCC.

Patch by Jonathan Wakely (jwakely).

Reviewed By: zoecarver

Differential Revision: https://reviews.llvm.org/D102327
This commit is contained in:
zoecarver 2021-05-13 10:09:15 -07:00
parent 7c2afd5899
commit 7f607ac6af
2 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ test(const std::size_t bits)
for (auto r : res)
{
std::size_t i = r, isub = 0;
for (; i < n1 & isub < n2; ++i, ++isub)
for (; i < n1 && isub < n2; ++i, ++isub)
in[i] = sub[isub];
invoke_on_all_policies(test_one_policy(), in.begin(), in.begin() + n1, sub.begin(), sub.begin() + n2,
std::equal_to<T>());

View File

@ -71,7 +71,7 @@ test()
{
Sequence<T> in(n1, [](std::size_t) { return T(0); });
std::size_t i = r, isub = 0;
for (; i < n1 & isub < n2; ++i, ++isub)
for (; i < n1 && isub < n2; ++i, ++isub)
in[i] = value;
invoke_on_all_policies(test_one_policy(), in.begin(), in.begin() + n1, n2, value, std::equal_to<T>());