diff options
| author | aavdonkin <[email protected]> | 2022-02-10 16:49:57 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:57 +0300 | 
| commit | fc8d3fe40009fab7705035e6ffdc3eb334307c80 (patch) | |
| tree | 727a724ad16999a718de495cb330555f602cf01a /library/cpp/containers/comptrie | |
| parent | fcd93d3533aed781986b121b1362ca188bd96367 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/containers/comptrie')
| -rw-r--r-- | library/cpp/containers/comptrie/protopacker.h | 36 | 
1 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/containers/comptrie/protopacker.h b/library/cpp/containers/comptrie/protopacker.h index 3e15866dc54..8f1c3892888 100644 --- a/library/cpp/containers/comptrie/protopacker.h +++ b/library/cpp/containers/comptrie/protopacker.h @@ -1,29 +1,29 @@ -#pragma once - +#pragma once  +   #include <util/stream/mem.h> -#include <util/ysaveload.h> - +#include <util/ysaveload.h>  +   template <class Proto>  class TProtoPacker { -public: +public:       TProtoPacker() = default; - +       void UnpackLeaf(const char* p, Proto& entry) const { -        TMemoryInput in(p + sizeof(ui32), SkipLeaf(p) - sizeof(ui32)); +        TMemoryInput in(p + sizeof(ui32), SkipLeaf(p) - sizeof(ui32));           entry.ParseFromArcadiaStream(&in); -    } +    }       void PackLeaf(char* p, const Proto& entry, size_t size) const { -        TMemoryOutput out(p, size + sizeof(ui32)); -        Save<ui32>(&out, size); +        TMemoryOutput out(p, size + sizeof(ui32));  +        Save<ui32>(&out, size);           entry.SerializeToArcadiaStream(&out); -    } +    }       size_t MeasureLeaf(const Proto& entry) const {          return entry.ByteSize() + sizeof(ui32);      } -    size_t SkipLeaf(const char* p) const { -        TMemoryInput in(p, sizeof(ui32)); -        ui32 size; -        Load<ui32>(&in, size); -        return size; -    } -}; +    size_t SkipLeaf(const char* p) const {  +        TMemoryInput in(p, sizeof(ui32));  +        ui32 size;  +        Load<ui32>(&in, size);  +        return size;  +    }  +};   | 
