From e5126c9448c854a02d9a6835d022d49110e1f0a9 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Thu, 17 Mar 2016 16:08:19 +0300 Subject: [PATCH] Review fixes. --- search/intermediate_result.cpp | 9 +++------ search/result.cpp | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/search/intermediate_result.cpp b/search/intermediate_result.cpp index bf20a2fb3c..d76016d4b0 100644 --- a/search/intermediate_result.cpp +++ b/search/intermediate_result.cpp @@ -173,13 +173,10 @@ string FormatStreetAndHouse(ReverseGeocoder::Address const & addr) string FormatFullAddress(ReverseGeocoder::Address const & addr, string const & region) { // TODO: Print "near" for not exact addresses. - string res; - //if (addr.GetDistance() >= 0 && addr.GetDistance() < 50.0) - if (addr.GetDistance() == 0) - res = FormatStreetAndHouse(addr); - else + if (addr.GetDistance() != 0) return region; - return res + ", " + region; + + return FormatStreetAndHouse(addr) + (region.empty() ? "" : ", ") + region; } } // namespace diff --git a/search/result.cpp b/search/result.cpp index acdd8fd7fd..7ff49c5a54 100644 --- a/search/result.cpp +++ b/search/result.cpp @@ -122,7 +122,7 @@ pair const & Result::GetHighlightRange(size_t idx) const void Result::AppendCity(string const & name) { - // Append only if city is absent in region (mwm) name. + // Prepend only if city is absent in region (mwm) name. if (m_address.find(name) == string::npos) m_address = name + ", " + m_address; }