mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[traffic] Prioritize message which are updates with an unchanged location
Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -651,11 +651,17 @@ void TrafficManager::DecodeFirstMessage()
|
||||
std::sort(m_feedQueue.front().begin(), m_feedQueue.front().end(),
|
||||
[this](const traffxml::TraffMessage & a, const traffxml::TraffMessage & b){
|
||||
// return a < b
|
||||
// cancellations before others
|
||||
// put messages first which decode quickly: cancellations, and updates with same location
|
||||
if (a.m_cancellation)
|
||||
return !b.m_cancellation;
|
||||
else if (b.m_cancellation)
|
||||
return false;
|
||||
auto aIt = m_messageCache.find(a.m_id);
|
||||
auto bIt = m_messageCache.find(b.m_id);
|
||||
if ((aIt != m_messageCache.end()) && (aIt->second.m_location == a.m_location))
|
||||
return !((bIt != m_messageCache.end()) && (bIt->second.m_location == b.m_location));
|
||||
else if ((bIt != m_messageCache.end()) && (bIt->second.m_location == b.m_location))
|
||||
return false;
|
||||
// sort by shortest distance between reference point and position/viewport
|
||||
std::vector<ms::LatLon> locations;
|
||||
if (m_currentPositionLazy.second)
|
||||
|
||||
Reference in New Issue
Block a user