summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max.kellermann@ionos.com>2024-10-04 15:10:51 +0200
committerMax Kellermann <max.kellermann@ionos.com>2024-11-13 21:00:29 +0100
commitc1fdc53bc7b5c472cd734ed4fe6b98fd3cf5af63 (patch)
tree6b07441512ae20cedc1d616e7014e7344a18f70f
parentosdc/Objecter: use the erase() return value (diff)
downloadceph-c1fdc53bc7b5c472cd734ed4fe6b98fd3cf5af63.tar.xz
ceph-c1fdc53bc7b5c472cd734ed4fe6b98fd3cf5af63.zip
osd/osd_types: use std::map::insert_or_assign()
This eliminates the overhead for constructing an empty value if the key does not yet exist. Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
-rw-r--r--src/osd/osd_types.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h
index b6f5335a0f5..19d82a7c259 100644
--- a/src/osd/osd_types.h
+++ b/src/osd/osd_types.h
@@ -1153,7 +1153,7 @@ public:
template<typename T>
void set(key_t key, const T &val) {
value_t value = val;
- opts[key] = value;
+ opts.insert_or_assign(key, value);
}
template<typename T>