From 1613f63ca56e90be044741a4dd7130bff4d7e23d Mon Sep 17 00:00:00 2001 From: Yury Melnichek Date: Tue, 12 Feb 2013 00:59:48 +0100 Subject: [PATCH] [search] Minor code review fixes. --- search/keyword_lang_matcher.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/search/keyword_lang_matcher.cpp b/search/keyword_lang_matcher.cpp index 583ac4c84f..11b674d0ad 100644 --- a/search/keyword_lang_matcher.cpp +++ b/search/keyword_lang_matcher.cpp @@ -46,12 +46,13 @@ int8_t KeywordLangMatcher::GetLanguage(pair const & ind) const int KeywordLangMatcher::GetLangScore(int8_t lang) const { - for (int i = 0; i < m_languagePriorities.size(); ++i) + int const prioritiesTiersCount = static_cast(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(m_languagePriorities.size()); + return -prioritiesTiersCount; } KeywordLangMatcher::ScoreT KeywordLangMatcher::Score(int8_t lang, string const & name) const