From c471f414953a9e40d3f00f469c3540c51be9a78e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 20 Dec 2020 12:42:10 +0800 Subject: [PATCH] test/erasure-code: fold variables with the same values for better readability Signed-off-by: Kefu Chai --- src/test/erasure-code/TestErasureCodeShec_arguments.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/test/erasure-code/TestErasureCodeShec_arguments.cc b/src/test/erasure-code/TestErasureCodeShec_arguments.cc index 14c4f5f403ceb..52684faac9094 100644 --- a/src/test/erasure-code/TestErasureCodeShec_arguments.cc +++ b/src/test/erasure-code/TestErasureCodeShec_arguments.cc @@ -229,19 +229,17 @@ TEST(ParameterTest, combination_all) EXPECT_FALSE(out1 == in); for (unsigned int w1 = 0; w1 <= shec->get_chunk_count(); ++w1) { - const unsigned int r1 = w1; // combination(k+m,r1) - + // combination(k+m,w1) int array_want_to_read[shec->get_chunk_count()]; for (unsigned int i = 0; i < shec->get_chunk_count(); ++i) { - array_want_to_read[i] = i < r1 ? 1 : 0; + array_want_to_read[i] = i < w1 ? 1 : 0; } for (unsigned w2 = 0; w2 <= shec->get_chunk_count(); ++w2) { - const unsigned int r2 = w2; // combination(k+m,r2) - + // combination(k+m,w2) int array_available_chunks[shec->get_chunk_count()]; for (unsigned int i = 0; i < shec->get_chunk_count(); ++i ) { - array_available_chunks[i] = i < r2 ? 1 : 0; + array_available_chunks[i] = i < w2 ? 1 : 0; } do { -- 2.39.5