Review fixes.

This commit is contained in:
y 2017-08-01 18:26:27 +03:00 committed by Roman Kuznetsov
parent b0e0fa8a87
commit 1bb30fc057
4 changed files with 6 additions and 13 deletions

View file

@ -1390,10 +1390,7 @@ bool Framework::SearchInViewport(search::ViewportSearchParams const & params)
std::string query = params.m_query;
strings::Trim(query);
strings::AsciiToLower(query);
if (query == "cian")
m_cianSearchMode = true;
else
m_cianSearchMode = false;
m_cianSearchMode = (query == "cian");
}
search::SearchParams p;

View file

@ -339,10 +339,7 @@ Geocoder::~Geocoder() {}
void Geocoder::SetParams(Params const & params)
{
m_params = params;
if (m_params.m_cianMode)
m_model.EnableCian();
else
m_model.DisableCian();
m_model.SetCianEnabled(m_params.m_cianMode);
m_tokenRequests.clear();
m_prefixTokenRequest.Clear();

View file

@ -107,10 +107,10 @@ SearchModel::SearchType SearchModel::GetSearchType(FeatureType const & feature)
static auto const & localityChecker = IsLocalityChecker::Instance();
static auto const & poiChecker = IsPoiChecker::Instance();
if (m_cianMode && cianChecker(feature))
if (m_cianEnabled && cianChecker(feature))
return SEARCH_TYPE_BUILDING;
if (!m_cianMode && buildingChecker(feature))
if (!m_cianEnabled && buildingChecker(feature))
return SEARCH_TYPE_BUILDING;
if (streetChecker(feature))

View file

@ -49,11 +49,10 @@ public:
SearchType GetSearchType(FeatureType const & feature) const;
void EnableCian() { m_cianMode = true; }
void DisableCian() { m_cianMode = false; }
void SetCianEnabled(bool enabled) { m_cianEnabled = enabled; }
private:
bool m_cianMode = false;
bool m_cianEnabled = false;
};
string DebugPrint(SearchModel::SearchType type);