From b20976e9c30ddb62574022e054497c59f01f11ba Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Thu, 16 Dec 2021 10:49:57 +0000 Subject: [PATCH] crimson/osd: removing an unneeded make_unique() As the desired lifetime of the object matches the lifetime if it is allocated on the stack, and as no ownership is transferred, there is no point in using a unique_ptr here. And see Google's guidance (https://abseil.io/tips/187), under "Common Anti-Pattern: Avoiding &". Signed-off-by: Ronen Friedman --- src/crimson/osd/main.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crimson/osd/main.cc b/src/crimson/osd/main.cc index 8526885bbfb..23ec839ca46 100644 --- a/src/crimson/osd/main.cc +++ b/src/crimson/osd/main.cc @@ -106,7 +106,8 @@ seastar::future<> make_keyring() fmt::print(std::cerr, "already have key in keyring: {}\n", path); return seastar::now(); } else { - auth.key.create(std::make_unique().get(), CEPH_CRYPTO_AES); + CephContext temp_cct{}; + auth.key.create(&temp_cct, CEPH_CRYPTO_AES); keyring.add(name, auth); bufferlist bl; keyring.encode_plaintext(bl); -- 2.39.5