[search] Minor code review fixes.

This commit is contained in:
Yury Melnichek 2013-02-12 00:59:48 +01:00 committed by Alex Zolotarev
parent 5a6d08106a
commit 1613f63ca5

View file

@ -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