diff options
author | tatiana-yan <tatiana.kondakova@gmail.com> | 2020-07-10 11:04:58 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2020-07-10 12:31:16 +0300 |
commit | a10181653324eed265f445fadc6fbd52f61ada9e (patch) | |
tree | 4fa86c7830ec3a7df2959bc8e3398f0a0eaf88d8 /search | |
parent | d889826bcc0a7e604a2e7d365207d509ed503dcc (diff) |
Review fixes.
Diffstat (limited to 'search')
-rw-r--r-- | search/ranker.cpp | 6 |
1 files 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 + ")"; } } |