Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/map
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-12-13 10:08:53 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-12-13 10:14:13 +0300
commit1edac74bb46b3d330e6c1cec7d592ef072276d1f (patch)
tree9dc2555df9518b5fd69cf3ad4cc91e0d2f99456c /map
parent49f9f9117c52a92485fd233565795a419f33482b (diff)
Review fixes.
Diffstat (limited to 'map')
-rw-r--r--map/traffic_manager.cpp11
-rw-r--r--map/traffic_manager.hpp1
2 files changed, 7 insertions, 5 deletions
diff --git a/map/traffic_manager.cpp b/map/traffic_manager.cpp
index 87de04ea3a..d12b5f7b5e 100644
--- a/map/traffic_manager.cpp
+++ b/map/traffic_manager.cpp
@@ -404,16 +404,16 @@ void TrafficManager::CheckCacheSize()
// Calculating number of different active mwms.
set<MwmSet::MwmId> activeMwms;
UniteActiveMwms(activeMwms);
- size_t const activeMwmsSize = activeMwms.size();
+ size_t const numActiveMwms = activeMwms.size();
- if (m_currentCacheSizeBytes > m_maxCacheSizeBytes && m_mwmCache.size() > activeMwmsSize)
+ if (m_currentCacheSizeBytes > m_maxCacheSizeBytes && m_mwmCache.size() > numActiveMwms)
{
std::multimap<time_point<steady_clock>, MwmSet::MwmId> seenTimings;
for (auto const & mwmInfo : m_mwmCache)
seenTimings.insert(make_pair(mwmInfo.second.m_lastActiveTime, mwmInfo.first));
auto itSeen = seenTimings.begin();
- while (m_currentCacheSizeBytes > m_maxCacheSizeBytes && m_mwmCache.size() > activeMwmsSize)
+ while (m_currentCacheSizeBytes > m_maxCacheSizeBytes && m_mwmCache.size() > numActiveMwms)
{
ClearCache(itSeen->second);
++itSeen;
@@ -465,7 +465,8 @@ void TrafficManager::UpdateState()
bool expiredData = false;
bool noData = false;
- ForEachActiveMwm([&](MwmSet::MwmId const & mwmId) {
+ for (MwmSet::MwmId const & mwmId : m_activeDrapeMwms)
+ {
auto it = m_mwmCache.find(mwmId);
ASSERT(it != m_mwmCache.end(), ());
@@ -490,7 +491,7 @@ void TrafficManager::UpdateState()
{
networkError = true;
}
- });
+ }
if (networkError || maxPassedTime >= kNetworkErrorTimeout)
ChangeState(TrafficState::NetworkError);
diff --git a/map/traffic_manager.hpp b/map/traffic_manager.hpp
index 4179055fd3..ffef9de631 100644
--- a/map/traffic_manager.hpp
+++ b/map/traffic_manager.hpp
@@ -60,6 +60,7 @@ public:
TrafficManager(GetMwmsByRectFn const & getMwmsByRectFn, size_t maxCacheSizeBytes,
traffic::TrafficObserver & observer);
+ TrafficManager(TrafficManager && /* trafficManager */) = default;
~TrafficManager();
void Teardown();