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
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2017-06-27 16:37:29 +0300
committerIlya Zverev <ilya@zverev.info>2017-06-27 17:06:11 +0300
commitcea279344babf03dde13f81abb50760e4ed10ed4 (patch)
tree67f63d53173b40247f581ee9cd3b9b561013b777 /indexer/road_shields_parser.cpp
parent334d30f1bafafb9e79c61ab7d31cc6034c3ae479 (diff)
Fixed roads shield parsing in US
Diffstat (limited to 'indexer/road_shields_parser.cpp')
-rw-r--r--indexer/road_shields_parser.cpp16
1 files 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<std::string> 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));
}