diff --git a/coding/file_container.hpp b/coding/file_container.hpp index 64b2865f15..7478d1888e 100644 --- a/coding/file_container.hpp +++ b/coding/file_container.hpp @@ -86,7 +86,7 @@ public: explicit FilesContainerR(string const & fName, uint32_t logPageSize = 10, uint32_t logPageCount = 10); - FilesContainerR(ReaderT const & file); + explicit FilesContainerR(ReaderT const & file); ReaderT GetReader(Tag const & tag) const; diff --git a/search/intermediate_result.cpp b/search/intermediate_result.cpp index 9e9c7ff57d..05f72fe4bc 100644 --- a/search/intermediate_result.cpp +++ b/search/intermediate_result.cpp @@ -271,8 +271,10 @@ bool PreResult2::LessLinearTypesF::operator() (PreResult2 const & r1, PreResult2 if (r1.m_str != r2.m_str) return (r1.m_str < r2.m_str); - if (r1.GetBestType() != r2.GetBestType()) - return (r1.GetBestType() < r2.GetBestType()); + uint32_t const t1 = r1.GetBestType(); + uint32_t const t2 = r2.GetBestType(); + if (t1 != t2) + return (t1 < t2); // Should stay the best feature, after unique, so add this criteria: @@ -287,8 +289,9 @@ bool PreResult2::EqualLinearTypesF::operator() (PreResult2 const & r1, PreResult { // filter equal linear features static IsLinearChecker checker; - return (r1.GetBestType() == r2.GetBestType() && - checker.IsMy(FirstLevelIndex(r1.GetBestType()))); + + uint32_t const t1 = r1.GetBestType(); + return (t1 == r2.GetBestType() && checker.IsMy(FirstLevelIndex(t1))); } return false; diff --git a/search/params.cpp b/search/params.cpp index 517b65a12f..98400f44a6 100644 --- a/search/params.cpp +++ b/search/params.cpp @@ -27,12 +27,10 @@ void SearchParams::SetPosition(double lat, double lon) void SearchParams::SetInputLanguage(string const & language) { // @TODO take into an account zh_pinyin, ko_rm and ja_rm - size_t delimPos = language.find("-"); - if (delimPos == string::npos) - delimPos = language.find("_"); + size_t const delimPos = language.find_first_of("-_"); m_inputLanguageCode = StringUtf8Multilang::GetLangIndex( - delimPos == string::npos ? language: language.substr(0, delimPos)); + delimPos == string::npos ? language : language.substr(0, delimPos)); } bool SearchParams::IsNearMeMode() const