From a10181653324eed265f445fadc6fbd52f61ada9e Mon Sep 17 00:00:00 2001 From: tatiana-yan Date: Fri, 10 Jul 2020 11:04:58 +0300 Subject: [PATCH] Review fixes. --- search/ranker.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/search/ranker.cpp b/search/ranker.cpp index 39594ce7c0..12512253ca 100644 --- a/search/ranker.cpp +++ b/search/ranker.cpp @@ -756,7 +756,7 @@ void Ranker::MakeRankerResults(Geocoder::Params const & geocoderParams, void Ranker::GetBestMatchName(FeatureType & f, string & name) const { - int8_t bestLang; + int8_t bestLang = StringUtf8Multilang::kUnsupportedLanguageCode; KeywordLangMatcher::Score bestScore; auto updateScore = [&](int8_t lang, string const & s, bool force) { // Ignore name for categorial requests. @@ -788,7 +788,9 @@ void Ranker::GetBestMatchName(FeatureType & f, string & name) const { string readableName; f.GetReadableName(readableName); - name = readableName + " (" + name + ")"; + // Do nothing if alt/old name is the only name we have. + if (readableName != name) + name = readableName + " (" + name + ")"; } }