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:
authorMaxim Pimenov <m@maps.me>2017-02-08 17:45:39 +0300
committerMaxim Pimenov <m@maps.me>2017-02-10 13:41:35 +0300
commitfa0d6036f342358218ef7950d6695e078c25f552 (patch)
tree24d01b6c1e32b1d9fc37c68c07546115dddf4e0b /indexer/categories_holder.cpp
parentb95690dcd7927babf961b48ec096b0712590ba43 (diff)
Review fixes.
Diffstat (limited to 'indexer/categories_holder.cpp')
-rw-r--r--indexer/categories_holder.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/indexer/categories_holder.cpp b/indexer/categories_holder.cpp
index ad2564f0ee..382d21f7f9 100644
--- a/indexer/categories_holder.cpp
+++ b/indexer/categories_holder.cpp
@@ -201,7 +201,7 @@ void CategoriesHolder::AddCategory(Category & cat, vector<uint32_t> & types)
for (auto const & synonym : p->m_synonyms)
{
auto const locale = synonym.m_locale;
- ASSERT(locale != kUnsupportedLocaleCode, ());
+ ASSERT_NOT_EQUAL(locale, kUnsupportedLocaleCode, ());
auto const uniName = search::NormalizeAndSimplifyString(synonym.m_name);
@@ -214,11 +214,8 @@ void CategoriesHolder::AddCategory(Category & cat, vector<uint32_t> & types)
continue;
for (uint32_t const t : types)
{
- if (m_name2type.find(locale) == m_name2type.end())
- m_name2type[locale] = make_unique<Trie>();
-
- auto * trie = m_name2type[locale].get();
- trie->Add(token, t);
+ auto it = m_name2type.emplace(locale, make_unique<Trie>()).first;
+ it->second->Add(token, t);
}
}
}