diff options
author | vng <viktor.govako@gmail.com> | 2015-09-10 14:53:25 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:04:55 +0300 |
commit | d167c19e2b203f94e440dd179f7248f495e978ce (patch) | |
tree | 76dd5be55d7cfd85139c474b6880d8f0e120894c /storage | |
parent | 6e1be81f7d23035b3e981d57459c929e6e93cf3f (diff) |
[search] Viewport search results now can be showed in the table. Need to pass region param.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/country_info.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/storage/country_info.cpp b/storage/country_info.cpp index 5290cbf64c..e5d3ac1b72 100644 --- a/storage/country_info.cpp +++ b/storage/country_info.cpp @@ -104,9 +104,7 @@ namespace storage { vector<m2::PointD> points; serial::LoadOuterPath(src, serial::CodingParams(), points); - - rgnV.push_back(m2::RegionD()); - rgnV.back().Assign(points.begin(), points.end()); + rgnV.emplace_back(points.begin(), points.end()); } } @@ -135,7 +133,7 @@ namespace storage void CountryInfoGetter::GetRegionInfo(string const & id, CountryInfo & info) const { - map<string, CountryInfo>::const_iterator i = m_id2info.find(id); + auto i = m_id2info.find(id); // Take into account 'minsk-pass'. if (i == m_id2info.end()) return; @@ -151,12 +149,10 @@ namespace storage template <class ToDo> void CountryInfoGetter::ForEachCountry(string const & prefix, ToDo toDo) const { - typedef vector<CountryDef>::const_iterator IterT; - - for (IterT i = m_countries.begin(); i != m_countries.end(); ++i) + for (auto const & c : m_countries) { - if (i->m_name.find(prefix) == 0) - toDo(*i); + if (c.m_name.find(prefix) == 0) + toDo(c); } /// @todo Store sorted list of polygons in PACKED_POLYGONS_FILE. |