[indexer] Fix variables initialization order: kSimilarToDeviceLanguages which depends from kLanguages(string_utf8_multilang.cpp) should not be global.

This commit is contained in:
tatiana-yan 2020-06-29 20:09:06 +03:00 committed by Arsentiy Milchakov
parent 66f0e55c94
commit 74d3e7e798

View file

@ -31,11 +31,6 @@ int8_t GetIndex(string const & lang)
return StrUtf8::GetLangIndex(lang);
}
unordered_map<int8_t, vector<int8_t>> const kSimilarToDeviceLanguages =
{
{GetIndex("be"), {GetIndex("ru")}}
};
void GetMwmLangName(feature::RegionData const & regionData, StringUtf8Multilang const & src, string & out)
{
vector<int8_t> mwmLangCodes;
@ -101,6 +96,11 @@ bool GetBestName(StringUtf8Multilang const & src, vector<int8_t> const & priorit
vector<int8_t> GetSimilarToDeviceLanguages(int8_t deviceLang)
{
static unordered_map<int8_t, vector<int8_t>> const kSimilarToDeviceLanguages =
{
{GetIndex("be"), {GetIndex("ru")}}
};
auto const it = kSimilarToDeviceLanguages.find(deviceLang);
if (it != kSimilarToDeviceLanguages.cend())
return it->second;