From 7444c87a02d6400057f82b0c465d90bac04cc07a Mon Sep 17 00:00:00 2001 From: tatiana-yan Date: Thu, 2 Jul 2020 11:23:27 +0300 Subject: [PATCH] Review fixes. --- indexer/ftypes_matcher.cpp | 9 +++++++-- indexer/ftypes_matcher.hpp | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp index dd42b10b6c..6a2e2755f7 100644 --- a/indexer/ftypes_matcher.cpp +++ b/indexer/ftypes_matcher.cpp @@ -320,12 +320,17 @@ SuburbType IsSuburbChecker::GetType(uint32_t t) const SuburbType IsSuburbChecker::GetType(feature::TypesHolder const & types) const { + auto smallestType = SuburbType::Count; for (uint32_t t : types) { auto const type = GetType(t); - if (type != SuburbType::None) - return type; + if (type != SuburbType::None && type < smallestType) + smallestType = type; } + + if (smallestType != SuburbType::Count) + return smallestType; + return SuburbType::None; } diff --git a/indexer/ftypes_matcher.hpp b/indexer/ftypes_matcher.hpp index 4c1ac63788..f2a4d31845 100644 --- a/indexer/ftypes_matcher.hpp +++ b/indexer/ftypes_matcher.hpp @@ -136,8 +136,9 @@ public: DECLARE_CHECKER_INSTANCE(IsSquareChecker); }; -/// Type of locality (do not change values and order - they have detalization order) -/// Suburb > Neighbourhood > Residential +// Type of suburb. +// Do not change values and order - they are in the order of decreasing specificity. +// Suburb > Neighbourhood > Residential enum class SuburbType { None = -1,