Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2015-06-18 14:26:05 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:52:04 +0300
commitfddad64d856f1af0ec9360b6d3c2f0c79c15b86d (patch)
treeaef066733c873719ef439e9a588e9bef081056ef /indexer/categories_holder.cpp
parentb329ee53bf429f4ee9aaa16c98dc4c91de45610f (diff)
[metadata] Renaming (refactoring) according to code style.
Diffstat (limited to 'indexer/categories_holder.cpp')
-rw-r--r--indexer/categories_holder.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/indexer/categories_holder.cpp b/indexer/categories_holder.cpp
index 293a620d0e..e573e2a0ea 100644
--- a/indexer/categories_holder.cpp
+++ b/indexer/categories_holder.cpp
@@ -192,17 +192,13 @@ bool CategoriesHolder::IsTypeExist(uint32_t type) const
return range.first != range.second;
}
-namespace
-{
-struct Mapping
-{
- char const * m_name;
- int8_t m_code;
-};
-} // namespace
-
int8_t CategoriesHolder::MapLocaleToInteger(string const & locale)
{
+ struct Mapping
+ {
+ char const * m_name;
+ int8_t m_code;
+ };
static const Mapping mapping[] = {
{"en", 1 },
{"ru", 2 },
@@ -237,11 +233,9 @@ int8_t CategoriesHolder::MapLocaleToInteger(string const & locale)
string lower = locale;
strings::AsciiToLower(lower);
- if (lower.find("hant") != string::npos
- || lower.find("tw") != string::npos
- || lower.find("hk") != string::npos
- || lower.find("mo") != string::npos)
- return 12; // Traditional Chinese
+ for (auto s : {"hant", "tw", "hk", "mo"})
+ if (lower.find(s) != string::npos)
+ return 12; // Traditional Chinese
return 17; // Simplified Chinese by default for all other cases
}