]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_dedup_tool: fix unnecessarily complicated bool returns
authorSamuel Just <sjust@redhat.com>
Sat, 17 Sep 2022 02:47:23 +0000 (02:47 +0000)
committermyoungwon oh <ohmyoungwon@gmail.com>
Mon, 19 Sep 2022 04:21:19 +0000 (13:21 +0900)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/tools/ceph_dedup_tool.cc

index c97b46e88139f67b7c2a727b636d636bef702636..c69cea69fe2d708e870e9293e585ae2b508fe918 100644 (file)
@@ -554,10 +554,7 @@ public:
     bool find(string& fp) {
       std::shared_lock lock(fingerprint_lock);
       auto found_item = fp_map.find(fp);
-      if (found_item != fp_map.end()) {
-        return true;
-      }
-      return false;
+      return found_item != fp_map.end();
     }
 
     // return true if the chunk is duplicate
@@ -570,10 +567,7 @@ public:
       }
       auto &target = found_iter->second;
       target++;
-      if (target >= dedup_threshold && dedup_threshold != -1) {
-        return true;
-      }
-      return false;
+      return target >= dedup_threshold && dedup_threshold != -1;
     }
 
     void init(size_t dedup_threshold_) {