From cea279344babf03dde13f81abb50760e4ed10ed4 Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Tue, 27 Jun 2017 16:37:29 +0300 Subject: [PATCH] Fixed roads shield parsing in US --- indexer/road_shields_parser.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/indexer/road_shields_parser.cpp b/indexer/road_shields_parser.cpp index 73c1d3657f..9bd0571db9 100644 --- a/indexer/road_shields_parser.cpp +++ b/indexer/road_shields_parser.cpp @@ -87,7 +87,7 @@ public: } // Minimum length for the network tag is 4 (US:I). - if (network.size() > 4) + if (network.size() >= 4) { strings::AsciiToLower(network); @@ -111,11 +111,17 @@ public: std::vector shieldsRawTests = strings::Tokenize(m_baseRoadNumber, ";"); for (std::string const & rawText : shieldsRawTests) { + RoadShield shield; auto slashPos = rawText.find('/'); - RoadShield shield = slashPos == std::string::npos - ? ParseRoadShield(rawText) - : RoadShield{FindNetworkShield(rawText.substr(0, slashPos)), - rawText.substr(slashPos + 1)}; + if (slashPos == std::string::npos) + { + shield = ParseRoadShield(rawText); + } + else + { + shield = ParseRoadShield(rawText.substr(slashPos + 1)); + shield.m_type = FindNetworkShield(rawText.substr(0, slashPos)); + } if (!shield.m_name.empty() && shield.m_type != RoadShieldType::Hidden) result.insert(std::move(shield)); }