diff --git a/drape_frontend/read_metaline_task.cpp b/drape_frontend/read_metaline_task.cpp index 154c354f76..fa7bca7671 100644 --- a/drape_frontend/read_metaline_task.cpp +++ b/drape_frontend/read_metaline_task.cpp @@ -16,6 +16,7 @@ #include "defines.hpp" #include +#include #include namespace @@ -25,7 +26,7 @@ double const kPointEqualityEps = 1e-7; struct MetalineData { std::vector m_features; - std::vector m_directions; + std::set m_reversed; }; std::vector ReadMetalinesFromFile(MwmSet::MwmId const & mwmId) @@ -45,9 +46,12 @@ std::vector ReadMetalinesFromFile(MwmSet::MwmId const & mwmId) for (auto i = ReadVarUint(src); i > 0; --i) { auto const fid = ReadVarInt(src); - data.m_features.emplace_back(mwmId, static_cast(std::abs(fid))); - data.m_directions.push_back(fid > 0); + FeatureID const featureId(mwmId, static_cast(std::abs(fid))); + data.m_features.emplace_back(featureId); + if (fid <= 0) + data.m_reversed.insert(featureId); } + std::sort(data.m_features.begin(), data.m_features.end()); model.push_back(std::move(data)); } } @@ -150,7 +154,7 @@ void ReadMetalineTask::Run() failed = true; return; } - if (!metaline.m_directions[curIndex]) + if (metaline.m_reversed.find(ft.GetID()) != metaline.m_reversed.cend()) std::reverse(featurePoints.begin(), featurePoints.end()); points.push_back(std::move(featurePoints)); diff --git a/drape_frontend/tile_info.cpp b/drape_frontend/tile_info.cpp index 4f8bc9abdc..06745187f0 100644 --- a/drape_frontend/tile_info.cpp +++ b/drape_frontend/tile_info.cpp @@ -13,6 +13,7 @@ #include "base/scope_guard.hpp" #include "base/logging.hpp" +#include #include using namespace std::placeholders; @@ -69,6 +70,7 @@ void TileInfo::ReadFeatures(MapDataProvider const & model) if (!m_featureInfo.empty()) { + std::sort(m_featureInfo.begin(), m_featureInfo.end()); auto const deviceLang = StringUtf8Multilang::GetLangIndex(languages::GetCurrentNorm()); RuleDrawer drawer(std::bind(&TileInfo::InitStylist, this, deviceLang, _1, _2), std::bind(&TileInfo::IsCancelled, this), diff --git a/map/transit/transit_reader.cpp b/map/transit/transit_reader.cpp index 69c21a5085..9f77102c0c 100644 --- a/map/transit/transit_reader.cpp +++ b/map/transit/transit_reader.cpp @@ -15,6 +15,7 @@ #include "base/stl_add.hpp" +#include #include using namespace routing; @@ -100,6 +101,7 @@ void ReadTransitTask::Do() vector features; for (auto & id : m_transitInfo->m_features) features.push_back(id.first); + sort(features.begin(), features.end()); m_readFeaturesFn([this](FeatureType const & ft) {