]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code/shec: replace 0 with nullptr when appropriate 57111/head
authorKefu Chai <tchaikov@gmail.com>
Sun, 28 Apr 2024 00:36:09 +0000 (08:36 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sun, 28 Apr 2024 00:56:54 +0000 (08:56 +0800)
0 fails to send the message to human readers that the variable is
a pointer, but nullptr does. for improving the readability, let's
use nullptr when the variable in question is a pointer.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/erasure-code/shec/ErasureCodeShecTableCache.cc
src/erasure-code/shec/ErasureCodeShecTableCache.h

index 2f9a60b62bc6402bd4a30d4cef5cf9a7f7e47ac8..04b5b3d4af27728e326153da6c0ebddc69bcefa4 100644 (file)
@@ -130,7 +130,7 @@ ErasureCodeShecTableCache::getEncodingTableNoLock(int technique, int k, int m, i
   // create a pointer to store an encoding table address
   if (!encoding_table[technique][k][m][c][w]) {
     encoding_table[technique][k][m][c][w] = new (int*);
-    *encoding_table[technique][k][m][c][w] = 0;
+    *encoding_table[technique][k][m][c][w] = nullptr;
   }
   return encoding_table[technique][k][m][c][w];
 }
index bed7fa0185926822edd09d50e44ddcf636e4fac5..f5e1b4e51cd89cd67012377c6e157528beaba19f 100644 (file)
@@ -42,10 +42,10 @@ class ErasureCodeShecTableCache {
     int* dm_column;  // size: k
     int* minimum;  // size: k+m
     DecodingCacheParameter() {
-      decoding_matrix = 0;
-      dm_row = 0;
-      dm_column = 0;
-      minimum = 0;
+      decoding_matrix = nullptr;
+      dm_row = nullptr;
+      dm_column = nullptr;
+      minimum = nullptr;
     }
     ~DecodingCacheParameter() {
       if (decoding_matrix) {