diff options
author | Maxim Pimenov <m@maps.me> | 2017-02-14 17:38:13 +0300 |
---|---|---|
committer | Maxim Pimenov <m@maps.me> | 2017-02-14 18:23:56 +0300 |
commit | 0ddbe71640f6b4b65221761204306711dd0158e1 (patch) | |
tree | 380e59665024eb1b86a1111329e76955996f0f16 /indexer/categories_holder.hpp | |
parent | a1f4ac5953e858dc4199a54e0eef81fde41ffaa2 (diff) |
Review fixes.
Diffstat (limited to 'indexer/categories_holder.hpp')
-rw-r--r-- | indexer/categories_holder.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/indexer/categories_holder.hpp b/indexer/categories_holder.hpp index 95050ca09e..03c773af09 100644 --- a/indexer/categories_holder.hpp +++ b/indexer/categories_holder.hpp @@ -4,6 +4,7 @@ #include "base/stl_helpers.hpp" #include "base/string_utils.hpp" +#include "std/algorithm.hpp" #include "std/deque.hpp" #include "std/iostream.hpp" #include "std/map.hpp" @@ -57,7 +58,7 @@ private: // Maps locale and category token to the list of corresponding types. // Locale is treated as a special symbol prepended to the token. - unique_ptr<Trie> m_name2type; + Trie m_name2type; GroupTranslations m_groupTranslations; @@ -111,7 +112,7 @@ public: void ForEachTypeByName(int8_t locale, String const & name, ToDo && toDo) const { auto const localePrefix = String(1, static_cast<strings::UniChar>(locale)); - m_name2type->ForEachInNode(localePrefix + name, + m_name2type.ForEachInNode(localePrefix + name, my::MakeIgnoreFirstArgument(forward<ToDo>(toDo))); } @@ -126,13 +127,13 @@ public: string GetReadableFeatureType(uint32_t type, int8_t locale) const; // Exposes the tries that map category tokens to types. - Trie const & GetNameToTypesTrie() const { return *m_name2type; } + Trie const & GetNameToTypesTrie() const { return m_name2type; } bool IsTypeExist(uint32_t type) const; inline void Swap(CategoriesHolder & r) { m_type2cat.swap(r.m_type2cat); - m_name2type.swap(r.m_name2type); + std::swap(m_name2type, r.m_name2type); } // Converts any language |locale| from UI to the corresponding |