]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/erasure-code: fold variables with the same values
authorKefu Chai <kchai@redhat.com>
Sun, 20 Dec 2020 04:42:10 +0000 (12:42 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 20 Dec 2020 05:13:21 +0000 (13:13 +0800)
for better readability

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/erasure-code/TestErasureCodeShec_arguments.cc

index 14c4f5f403cebd5824f9743e5f1bae952c8a6f94..52684faac90946efac7e75ee7b40804f82985b46 100644 (file)
@@ -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 {