From 7b4aa5989029d7335870359cf93bdba4e514f3ab Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Mon, 11 Jul 2022 11:52:09 -0400 Subject: [PATCH] rgw: Fix `rgw::sal::Bucket::empty` static method signatures `unique_ptr` overload should take by reference. Both should be const. Signed-off-by: Adam C. Emerson (cherry picked from commit b1d3e6c00674ebf6bde08968789a426d65db73d9) Conflicts: src/rgw/rgw_sal.h - `unique_ptr` overload of empty Fixes: https://tracker.ceph.com/issues/56585 Signed-off-by: Adam C. Emerson (cherry picked from commit e40ce4a3511e669e761da5f39d81b14e6cdbdeba) Resolves: rhbz#118423 Signed-off-by: Adam C. Emerson --- src/rgw/rgw_sal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index cc551a43fe91c..9d02cbbfdf501 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -734,7 +734,9 @@ class Bucket { bool versioning_enabled() { return info.versioning_enabled(); } /** Check if a Bucket pointer is empty */ - static bool empty(Bucket* b) { return (!b || b->empty()); } + static bool empty(const Bucket* b) { return (!b || b->empty()); } + /** Check if a Bucket unique pointer is empty */ + static bool empty(const std::unique_ptr& b) { return (!b || b->empty()); } /** Clone a copy of this bucket. Used when modification is necessary of the copy */ virtual std::unique_ptr clone() = 0; -- 2.39.5