From d44c5fd58aa65683aad85c0e9d02cd5376e60df5 Mon Sep 17 00:00:00 2001 From: Arsentiy Milchakov Date: Wed, 27 Nov 2019 17:20:01 +0300 Subject: [PATCH] [catalog] catalog headers duplication is fixed --- map/catalog_headers_provider.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/map/catalog_headers_provider.cpp b/map/catalog_headers_provider.cpp index c286fcddd0..884c1c4a19 100644 --- a/map/catalog_headers_provider.cpp +++ b/map/catalog_headers_provider.cpp @@ -1,5 +1,7 @@ #include "map/catalog_headers_provider.hpp" +#include + CatalogHeadersProvider::CatalogHeadersProvider(PositionProvider const & positionProvider, storage::Storage const & storage) : m_positionProvider(positionProvider) @@ -15,17 +17,18 @@ platform::HttpClient::Headers CatalogHeadersProvider::GetHeaders() storage::CountriesVec localMaps; m_storage.GetLocalRealMaps(localMaps); auto const & countryToCity = m_storage.GetMwmTopCityGeoIds(); - auto & countries = params.m_countryGeoIds; + std::set countries; auto & cities = params.m_cityGeoIds; for (auto const id : localMaps) { auto const countryIds = m_storage.GetTopCountryGeoIds(id); - countries.insert(countries.end(), countryIds.cbegin(), countryIds.cend()); + countries.insert(countryIds.cbegin(), countryIds.cend()); auto const cityIt = countryToCity.find(id); if (cityIt != countryToCity.cend()) cities.push_back(cityIt->second); } + params.m_countryGeoIds.assign(countries.cbegin(), countries.cend()); return web_api::GetCatalogHeaders(params); }