Skip to content

Commit 58cb7e1

Browse files
[test] Simplify shuffle_test while pleasing gcc static analysis
1 parent 6b61b1a commit 58cb7e1

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

test/test_shuffle.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,12 +621,10 @@ struct shuffle_test
621621
{
622622
B b_lhs = B::load_unaligned(lhs.data());
623623
std::array<B, size> b_matrix;
624-
for (size_t i = 0; i < size; ++i)
625-
b_matrix[i] = b_lhs;
624+
std::fill(b_matrix.begin(), b_matrix.end(), b_lhs);
626625
std::array<value_type, size * size> ref_matrix;
627626
for (size_t i = 0; i < size; ++i)
628-
for (size_t j = 0; j < size; ++j)
629-
ref_matrix[i * size + j] = lhs[i];
627+
std::fill(&ref_matrix[i*size], &ref_matrix[(i + 1)*size], lhs[i]);
630628

631629
INFO("transpose");
632630
xsimd::transpose(b_matrix.data(), b_matrix.data() + b_matrix.size());

0 commit comments

Comments
 (0)