diff --git a/lib/Makefile.am b/lib/Makefile.am index d42ac51a..b0663523 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -37,7 +37,6 @@ AM_CFLAGS= \ $(json_flag) \ -Wno-format-nonliteral \ -Wno-switch-enum \ - -Wno-suggest-attribute=format \ -Wno-deprecated-declarations \ -Wno-inline diff --git a/lib/mu-contacts.cc b/lib/mu-contacts.cc index 3936ae57..905123ea 100644 --- a/lib/mu-contacts.cc +++ b/lib/mu-contacts.cc @@ -20,7 +20,6 @@ #include "mu-contacts.hh" #include -#include #include #include #include @@ -90,7 +89,7 @@ struct ContactInfoLessThan { } }; -using ContactUMap = std::unordered_map; +using ContactUMap = std::unordered_map; //using ContactUSet = std::unordered_set; using ContactSet = std::set, ContactInfoLessThan>; @@ -150,7 +149,7 @@ Contacts::serialize() const std::lock_guard l_{priv_->mtx_}; std::string s; - for (const auto& item: priv_->contacts_) { + for (auto& item: priv_->contacts_) { const auto& ci{item.second}; s += Mux::format("%s%s" "%s%s" @@ -188,9 +187,9 @@ Contacts::add (ContactInfo&& ci) if (!ci.name.empty()) ci2.name = std::move(ci.name); } - } else { - priv_->contacts_.emplace(std::move(email), std::move(ci)); - } + } else + priv_->contacts_.emplace( + ContactUMap::value_type(std::move(email), std::move(ci))); } diff --git a/lib/mu-contacts.hh b/lib/mu-contacts.hh index 19cc6614..134ee05c 100644 --- a/lib/mu-contacts.hh +++ b/lib/mu-contacts.hh @@ -23,6 +23,7 @@ #include #include #include +#include #include #include