From 31b0c047fd38f45af6c414ebd2ed7d877721321a Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Sat, 17 Sep 2022 02:47:23 +0000 Subject: [PATCH] ceph_dedup_tool: fix unnecessarily complicated bool returns Signed-off-by: Samuel Just --- src/tools/ceph_dedup_tool.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/tools/ceph_dedup_tool.cc b/src/tools/ceph_dedup_tool.cc index c97b46e88139f..c69cea69fe2d7 100644 --- a/src/tools/ceph_dedup_tool.cc +++ b/src/tools/ceph_dedup_tool.cc @@ -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_) { -- 2.39.5