diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/containers/comptrie/minimize.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/containers/comptrie/minimize.h')
-rw-r--r-- | library/cpp/containers/comptrie/minimize.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/containers/comptrie/minimize.h b/library/cpp/containers/comptrie/minimize.h index baaa431d04..2464571437 100644 --- a/library/cpp/containers/comptrie/minimize.h +++ b/library/cpp/containers/comptrie/minimize.h @@ -6,24 +6,24 @@ class IOutputStream; namespace NCompactTrie { - size_t MeasureOffset(size_t offset); + size_t MeasureOffset(size_t offset); - enum EMinimizeMode { - MM_DEFAULT, // alollocate new memory for minimized tree - MM_NOALLOC, // minimize tree in the same buffer - MM_INPLACE // do not write tree to the stream, but move to the buffer beginning - }; + enum EMinimizeMode { + MM_DEFAULT, // alollocate new memory for minimized tree + MM_NOALLOC, // minimize tree in the same buffer + MM_INPLACE // do not write tree to the stream, but move to the buffer beginning + }; - // Return value: size of the minimized trie. - size_t RawCompactTrieMinimizeImpl(IOutputStream& os, TOpaqueTrie& trie, bool verbose, size_t minMergeSize, EMinimizeMode mode); + // Return value: size of the minimized trie. + size_t RawCompactTrieMinimizeImpl(IOutputStream& os, TOpaqueTrie& trie, bool verbose, size_t minMergeSize, EMinimizeMode mode); - // Return value: size of the minimized trie. - template <class TPacker> - size_t CompactTrieMinimizeImpl(IOutputStream& os, const char* data, size_t datalength, bool verbose, const TPacker* packer, EMinimizeMode mode) { - TPackerLeafSkipper<TPacker> skipper(packer); - size_t minmerge = MeasureOffset(datalength); - TOpaqueTrie trie(data, datalength, skipper); - return RawCompactTrieMinimizeImpl(os, trie, verbose, minmerge, mode); - } + // Return value: size of the minimized trie. + template <class TPacker> + size_t CompactTrieMinimizeImpl(IOutputStream& os, const char* data, size_t datalength, bool verbose, const TPacker* packer, EMinimizeMode mode) { + TPackerLeafSkipper<TPacker> skipper(packer); + size_t minmerge = MeasureOffset(datalength); + TOpaqueTrie trie(data, datalength, skipper); + return RawCompactTrieMinimizeImpl(os, trie, verbose, minmerge, mode); + } } |