diff --git a/map/traffic_manager.cpp b/map/traffic_manager.cpp index bbeb1222d..eabbdfbbc 100644 --- a/map/traffic_manager.cpp +++ b/map/traffic_manager.cpp @@ -404,7 +404,7 @@ void TrafficManager::InitializeDataSources(std::vector & dataS * If we batch-decode segments, we need to fix the [partner] segment IDs in the segment and path * structures to accept a TraFF message ID (string) rather than an integer. */ -void TrafficManager::DecodeMessage(traffxml::TraffMessage & message, std::map & trafficCache) { if (message.m_location) @@ -460,7 +460,6 @@ void TrafficManager::DecodeMessage(traffxml::TraffMessage & message, std::mapGetCountryName(); auto fid = paths[i].m_path[j].GetFeatureId().m_index; auto segment = paths[i].m_path[j].GetSegId(); uint8_t direction = paths[i].m_path[j].IsForward() ? @@ -504,7 +503,7 @@ void TrafficManager::DecodeMessage(traffxml::TraffMessage & message, std::map allMwmColoring; + //TODO should we use std::map> ? + // TODO store mwm/segment/speed group map with each message, build allMwmColoring on the fly + std::map allMwmColoring; for (auto [id, message] : m_messageCache) { LOG(LINFO, (" ", id, ":", message)); @@ -703,7 +697,7 @@ void TrafficManager::OnTrafficRequestFailed(traffic::TrafficInfo && info) } #endif -void TrafficManager::OnTrafficDataUpdate(std::map & trafficCache) +void TrafficManager::OnTrafficDataUpdate(std::map & trafficCache) { /* * Much of this code is copied and pasted together from old MWM code, with some minor adaptations: @@ -716,7 +710,7 @@ void TrafficManager::OnTrafficDataUpdate(std::mapGetCountryName()); + auto tcit = trafficCache.find(mwmId); if (tcit != trafficCache.end()) { std::lock_guard lock(m_mutex); diff --git a/map/traffic_manager.hpp b/map/traffic_manager.hpp index c354e00fc..4838381f1 100644 --- a/map/traffic_manager.hpp +++ b/map/traffic_manager.hpp @@ -260,7 +260,7 @@ private: * @param trafficCache The cache in which all decoded paths with their speed groups will be stored. */ void DecodeMessage(traffxml::TraffMessage & message, - std::map & trafficCache); + std::map &trafficCache); /** * @brief Event loop for the traffic worker thread. @@ -290,7 +290,7 @@ private: * * @param trafficCache The new per-MWM colorings (preprocessed traffic information). */ - void OnTrafficDataUpdate(std::map & trafficCache); + void OnTrafficDataUpdate(std::map &trafficCache); // TODO no longer needed #ifdef traffic_dead_code