forked from organicmaps/organicmaps
[search] Minor code review fixes.
This commit is contained in:
parent
5a6d08106a
commit
1613f63ca5
1 changed files with 3 additions and 2 deletions
|
@ -46,12 +46,13 @@ int8_t KeywordLangMatcher::GetLanguage(pair<int, int> const & ind) const
|
|||
|
||||
int KeywordLangMatcher::GetLangScore(int8_t lang) const
|
||||
{
|
||||
for (int i = 0; i < m_languagePriorities.size(); ++i)
|
||||
int const prioritiesTiersCount = static_cast<int>(m_languagePriorities.size());
|
||||
for (int i = 0; i < prioritiesTiersCount; ++i)
|
||||
for (int j = 0; j < m_languagePriorities[i].size(); ++j)
|
||||
if (m_languagePriorities[i][j] == lang)
|
||||
return -i; // All languages in the same tier are equal.
|
||||
|
||||
return -static_cast<int>(m_languagePriorities.size());
|
||||
return -prioritiesTiersCount;
|
||||
}
|
||||
|
||||
KeywordLangMatcher::ScoreT KeywordLangMatcher::Score(int8_t lang, string const & name) const
|
||||
|
|
Loading…
Add table
Reference in a new issue