diff options
author | Max Kellermann <max.kellermann@ionos.com> | 2024-10-04 15:10:51 +0200 |
---|---|---|
committer | Max Kellermann <max.kellermann@ionos.com> | 2024-11-13 21:00:29 +0100 |
commit | c1fdc53bc7b5c472cd734ed4fe6b98fd3cf5af63 (patch) | |
tree | 6b07441512ae20cedc1d616e7014e7344a18f70f | |
parent | osdc/Objecter: use the erase() return value (diff) | |
download | ceph-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.h | 2 |
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> |