From 71c1a2967f2358832086895b79755352bef56aab Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 4 Oct 2024 15:05:11 +0200 Subject: osd/osd_types: perfect forwarding in pool_opts_t::set() This eliminates temporary objects. Signed-off-by: Max Kellermann --- src/osd/osd_types.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 19d82a7c259..055fa8bc80c 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -1151,9 +1151,8 @@ public: bool is_set(key_t key) const; template - void set(key_t key, const T &val) { - value_t value = val; - opts.insert_or_assign(key, value); + void set(key_t key, T &&val) { + opts.insert_or_assign(key, std::forward(val)); } template -- cgit v1.2.3