diff --git a/traffic/traffic_cache.cpp b/traffic/traffic_cache.cpp index 604aeee80f..23037a2cd2 100644 --- a/traffic/traffic_cache.cpp +++ b/traffic/traffic_cache.cpp @@ -2,29 +2,28 @@ namespace traffic { -using namespace std; -void TrafficCache::Set(MwmSet::MwmId const & mwmId, shared_ptr coloring) +void TrafficCache::Set(MwmSet::MwmId const & mwmId, std::shared_ptr coloring) { - lock_guard guard(mutex); - m_trafficColoring[mwmId] = coloring; + auto guard = std::lock_guard(m_mutex); + m_trafficColoring[mwmId] = std::move(coloring); } void TrafficCache::Remove(MwmSet::MwmId const & mwmId) { - lock_guard guard(mutex); + auto guard = std::lock_guard(m_mutex); m_trafficColoring.erase(mwmId); } void TrafficCache::CopyTraffic(AllMwmTrafficInfo & trafficColoring) const { - lock_guard guard(mutex); + auto guard = std::lock_guard(m_mutex); trafficColoring = m_trafficColoring; } void TrafficCache::Clear() { - lock_guard guard(mutex); + auto guard = std::lock_guard(m_mutex); m_trafficColoring.clear(); } } // namespace traffic diff --git a/traffic/traffic_cache.hpp b/traffic/traffic_cache.hpp index 2e960e7700..d80a5f3536 100644 --- a/traffic/traffic_cache.hpp +++ b/traffic/traffic_cache.hpp @@ -15,7 +15,7 @@ using AllMwmTrafficInfo = std::map