From 980d407d507ffb4f0ca4c267e74fde324356d00b Mon Sep 17 00:00:00 2001 From: tatiana-yan Date: Tue, 23 Apr 2019 11:27:08 +0300 Subject: [PATCH] [search] Match highways from different classes for removig duplicating linear search results. --- search/intermediate_result.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/search/intermediate_result.cpp b/search/intermediate_result.cpp index 8222f999ae..2b1f543179 100644 --- a/search/intermediate_result.cpp +++ b/search/intermediate_result.cpp @@ -146,7 +146,16 @@ bool RankerResult::GetCountryId(storage::CountryInfoGetter const & infoGetter, u bool RankerResult::IsEqualCommon(RankerResult const & r) const { - return m_geomType == r.m_geomType && GetBestType() == r.GetBestType() && m_str == r.m_str; + if ((m_geomType != r.m_geomType) || (m_str != r.m_str)) + return false; + + auto const bestType = GetBestType(); + auto const rBestType = r.GetBestType(); + if (bestType == rBestType) + return true; + + auto const & checker = ftypes::IsWayChecker::Instance(); + return checker(bestType) && checker(rBestType); } bool RankerResult::IsStreet() const { return ftypes::IsStreetOrSuburbChecker::Instance()(m_types); }