From 7394af7391b31096db24e77bceb46256191005c9 Mon Sep 17 00:00:00 2001 From: Felix Heitmann Date: Tue, 9 Jul 2024 14:52:58 +0200 Subject: [PATCH] Attributes: use proper function for overwriting attributes --- include/spdlog/attributes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdlog/attributes.h b/include/spdlog/attributes.h index 462803ba..33a65c87 100644 --- a/include/spdlog/attributes.h +++ b/include/spdlog/attributes.h @@ -46,7 +46,7 @@ public: void put(attr_map_t const& attributes) { auto lck = lock(); - attrs.insert(attributes.begin(), attributes.end()); + for (auto const& attribute : attributes) attrs.insert_or_assign(attribute.first, attribute.second); } void put(const key_t& key, const value_t& value) { put({{key, value}}); }