diff options
author | tatiana-yan <tatiana.kondakova@gmail.com> | 2019-04-23 11:27:08 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2019-04-23 18:16:01 +0300 |
commit | 980d407d507ffb4f0ca4c267e74fde324356d00b (patch) | |
tree | b3fee4afb6d9e7380aa6def3d11e1969af339cc4 | |
parent | bfeb85425bbbc32d653a3b68e49b1c52be588eeb (diff) |
[search] Match highways from different classes for removig duplicating linear search results.
-rw-r--r-- | search/intermediate_result.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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); } |