From 372fbcf78dd0c54879d4dffdc460428390932540 Mon Sep 17 00:00:00 2001 From: Anatoly Serdtcev Date: Fri, 19 Jul 2019 18:26:13 +0300 Subject: [PATCH] [generator:regions] Fix duplicate of regions in mvm-repack --- generator/generator_tests/regions_tests.cpp | 17 +++++++++-------- generator/regions/node.cpp | 5 ----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/generator/generator_tests/regions_tests.cpp b/generator/generator_tests/regions_tests.cpp index 30b87dc639..bbcea0ebfc 100644 --- a/generator/generator_tests/regions_tests.cpp +++ b/generator/generator_tests/regions_tests.cpp @@ -567,20 +567,21 @@ UNIT_TEST(RegionsBuilderTest_GenerateRusMoscowSuburb) TEST(HasName(regions, u8"Россия, region: Москва"), ()); TEST(HasName(regions, - u8"Россия, region: Москва, subregion: Западный административный округ, " - u8"locality: Москва"), + u8"Россия, region: Москва, locality: Москва, " + u8"subregion: Западный административный округ"), ()); TEST(HasName(regions, - u8"Россия, region: Москва, subregion: Западный административный округ, " - u8"locality: Москва, suburb: Раменки"), + u8"Россия, region: Москва, locality: Москва, " + u8"subregion: Западный административный округ, suburb: Раменки"), ()); TEST(HasName(regions, - u8"Россия, region: Москва, subregion: Западный административный округ, " - u8"locality: Москва, suburb: Раменки, sublocality: Воробъёвы горы"), + u8"Россия, region: Москва, locality: Москва, " + u8"subregion: Западный административный округ, " + u8"suburb: Раменки, sublocality: Воробъёвы горы"), ()); TEST(HasName(regions, - u8"Россия, region: Москва, subregion: Западный административный округ, " - u8"locality: Москва, sublocality: Центр"), + u8"Россия, region: Москва, locality: Москва, " + u8"subregion: Западный административный округ, sublocality: Центр"), ()); TEST(!ContainsSubname(regions, u8"Тропарёво"), ()); } diff --git a/generator/regions/node.cpp b/generator/regions/node.cpp index 4bc9a54b4a..ba494f238b 100644 --- a/generator/regions/node.cpp +++ b/generator/regions/node.cpp @@ -63,11 +63,6 @@ NodePath MakeLevelPath(Node::Ptr const & node) } std::reverse(path.begin(), path.end()); - // Sort by level in case that megapolis (PlaceLevel::Locality) contains subregions - // (PlaceLevel::Subregions). - std::sort(path.begin(), path.end(), [](Node::Ptr const & l, Node::Ptr const & r) { - return l->GetData().GetLevel() < r->GetData().GetLevel(); - }); return path; }