diff options
author | Geir Storli <geirst@verizonmedia.com> | 2019-08-22 14:15:42 +0000 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2019-08-22 14:15:42 +0000 |
commit | ec6553764841765c86a4324802b1d509d1934035 (patch) | |
tree | e51eb123f69e25b30834bd6e702ad07051b4ecf3 /vespalib | |
parent | 573e34dc1ff2f9be5b76c8505fcda6c1b98a2da1 (diff) |
Rewrite enum store dictionary to inherit unique store dictionary.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.h | 4 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.hpp | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.h b/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.h index c6c73b09259..c09aab25c69 100644 --- a/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.h +++ b/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.h @@ -18,7 +18,9 @@ class UniqueStoreDictionary : public UniqueStoreDictionaryBase public: using Dictionary = DictionaryType; -private: +protected: + using DataType = typename DictionaryType::DataType; + DictionaryType _dict; public: diff --git a/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.hpp b/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.hpp index b73c245956e..d4a275cd12e 100644 --- a/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.hpp +++ b/vespalib/src/vespa/vespalib/datastore/unique_store_dictionary.hpp @@ -58,7 +58,7 @@ UniqueStoreDictionary<DictionaryType>::add(const EntryComparator &comp, } else { EntryRef newRef = insertEntry(); - _dict.insert(itr, newRef, btree::BTreeNoLeafData()); + _dict.insert(itr, newRef, DataType()); return UniqueStoreAddResult(newRef, true); } } @@ -126,7 +126,7 @@ UniqueStoreDictionary<DictionaryType>::build(const std::vector<EntryRef> &refs, typename Dictionary::Builder builder(_dict.getAllocator()); for (size_t i = 1; i < refs.size(); ++i) { if (ref_counts[i] != 0u) { - builder.insert(refs[i], btree::BTreeNoLeafData()); + builder.insert(refs[i], DataType()); } else { hold(refs[i]); } |