diff --git a/cmdopt.cpp b/cmdopt.cpp index 04dc5246..c478534b 100644 --- a/cmdopt.cpp +++ b/cmdopt.cpp @@ -465,7 +465,7 @@ invalid_key::what (void) const noexcept /////////////////////////////////////////////////////////////////////////////// invalid_value::invalid_value (std::string _value): - m_value (_value) + m_value (std::move (_value)) { ; } diff --git a/json/except.cpp b/json/except.cpp index 2eb0551f..bb85fd1a 100644 --- a/json/except.cpp +++ b/json/except.cpp @@ -38,5 +38,5 @@ json::parse_error::what (void) const noexcept /////////////////////////////////////////////////////////////////////////////// json::key_error::key_error (std::string _key): error (to_string (util::format::printf ("missing key '%s'", _key))), - key (_key) + key (std::move (_key)) { ; } diff --git a/stringid.cpp b/stringid.cpp index fad528d5..f292ecfc 100644 --- a/stringid.cpp +++ b/stringid.cpp @@ -23,13 +23,13 @@ using util::stringid; //----------------------------------------------------------------------------- stringid::id_t -stringid::add (const std::string key) { +stringid::add (std::string key) { auto pos = m_map.find (key); if (pos != m_map.end ()) throw std::invalid_argument ("duplicate stringid key"); id_t id = m_map.size (); - m_map[key] = id; + m_map.insert ({ std::move (key), id }); return id; } diff --git a/time.cpp b/time.cpp index 2be46660..f3599d0b 100644 --- a/time.cpp +++ b/time.cpp @@ -101,7 +101,7 @@ util::rate_limiter::poll (void) /////////////////////////////////////////////////////////////////////////////// util::polled_duration::polled_duration (std::string name, uint64_t interval): - m_name (name), + m_name (std::move (name)), m_interval (interval), m_next (nanoseconds () + interval) { ; }