diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2016-04-27 17:07:07 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2016-05-01 10:28:03 +0300 |
commit | 21e50e2d5e3f2fca71cc4da012e6d2687ed773a2 (patch) | |
tree | 75d7ca72b65b36452c85da23fc6e53a32dce066e /indexer/categories_index.hpp | |
parent | 60f44c06991d632771a6ed7c83077c312f5cd65f (diff) |
[indexer] Added move assignment operator for CategoriesIndex.
Diffstat (limited to 'indexer/categories_index.hpp')
-rw-r--r-- | indexer/categories_index.hpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/indexer/categories_index.hpp b/indexer/categories_index.hpp index bda1bbb1fc..02ac8d104e 100644 --- a/indexer/categories_index.hpp +++ b/indexer/categories_index.hpp @@ -18,17 +18,18 @@ class CategoriesIndex public: using TCategory = CategoriesHolder::Category; - CategoriesIndex() : m_catHolder(GetDefaultCategories()) {} + CategoriesIndex() : m_catHolder(&GetDefaultCategories()) {} - CategoriesIndex(CategoriesHolder const & catHolder) : m_catHolder(catHolder) {} + CategoriesIndex(CategoriesHolder const * catHolder) : m_catHolder(catHolder) {} CategoriesIndex(CategoriesIndex && other) : m_catHolder(other.m_catHolder), m_trie(move(other.m_trie)) { } - CategoriesHolder const & GetCategoriesHolder() const { return m_catHolder; } + CategoriesIndex & operator=(CategoriesIndex && other) = default; + CategoriesHolder const * GetCategoriesHolder() const { return m_catHolder; } // Adds all categories that match |type|. Only synonyms // in language |lang| are added. See indexer/categories_holder.cpp // for language enumeration. @@ -58,11 +59,11 @@ public: void GetAssociatedTypes(string const & query, vector<uint32_t> & result) const; #ifdef DEBUG - inline int GetNumTrieNodes() const { return m_trie.GetNumNodes(); } + inline size_t GetNumTrieNodes() const { return m_trie.GetNumNodes(); } #endif private: - CategoriesHolder const & m_catHolder; + CategoriesHolder const * m_catHolder = nullptr; my::MemTrie<string, uint32_t> m_trie; }; } // namespace indexer |