aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers
diff options
context:
space:
mode:
authorsmikler <smikler@yandex-team.ru>2022-02-10 16:49:33 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:33 +0300
commit0e68ae909d3b76a5a001a07880eb0010dec6b2ea (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/containers
parente4f0fd4ab53ca40eb91e750cf3e7f76c21e930db (diff)
downloadydb-0e68ae909d3b76a5a001a07880eb0010dec6b2ea.tar.gz
Restoring authorship annotation for <smikler@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/containers')
-rw-r--r--library/cpp/containers/comptrie/comptrie_trie.h16
-rw-r--r--library/cpp/containers/comptrie/comptrie_ut.cpp4
-rw-r--r--library/cpp/containers/comptrie/leaf_skipper.h34
-rw-r--r--library/cpp/containers/comptrie/opaque_trie_iterator.cpp2
-rw-r--r--library/cpp/containers/comptrie/protopacker.h12
5 files changed, 34 insertions, 34 deletions
diff --git a/library/cpp/containers/comptrie/comptrie_trie.h b/library/cpp/containers/comptrie/comptrie_trie.h
index 8be73307e2..40ec1e52b3 100644
--- a/library/cpp/containers/comptrie/comptrie_trie.h
+++ b/library/cpp/containers/comptrie/comptrie_trie.h
@@ -331,7 +331,7 @@ bool TCompactTrie<T, D, S>::Find(const TSymbol* key, size_t keylen, TData* value
if (!LookupLongestPrefix(key, keylen, prefixLen, valuepos, hasNext) || prefixLen != keylen)
return false;
if (value)
- Packer.UnpackLeaf(valuepos, *value);
+ Packer.UnpackLeaf(valuepos, *value);
return true;
}
@@ -468,7 +468,7 @@ bool TCompactTrie<T, D, S>::FindLongestPrefix(const TSymbol* key, size_t keylen,
if (prefixLen)
*prefixLen = tempPrefixLen;
if (found && value)
- Packer.UnpackLeaf(valuepos, *value);
+ Packer.UnpackLeaf(valuepos, *value);
if (hasNext)
*hasNext = tempHasNext;
return found;
@@ -647,16 +647,16 @@ const char* TCompactTrie<T, D, S>::TConstIterator::GetValuePtr() const {
template <class T, class D, class S>
typename TCompactTrie<T, D, S>::TData TCompactTrie<T, D, S>::TConstIterator::GetValue() const {
- D data;
- GetValue(data);
- return data;
-}
-
+ D data;
+ GetValue(data);
+ return data;
+}
+
template <class T, class D, class S>
void TCompactTrie<T, D, S>::TConstIterator::GetValue(typename TCompactTrie<T, D, S>::TData& data) const {
const char* ptr = GetValuePtr();
if (ptr) {
- Packer.UnpackLeaf(ptr, data);
+ Packer.UnpackLeaf(ptr, data);
} else {
data = typename TCompactTrie<T, D, S>::TData();
}
diff --git a/library/cpp/containers/comptrie/comptrie_ut.cpp b/library/cpp/containers/comptrie/comptrie_ut.cpp
index 7e773d4b06..74bee09b5d 100644
--- a/library/cpp/containers/comptrie/comptrie_ut.cpp
+++ b/library/cpp/containers/comptrie/comptrie_ut.cpp
@@ -1016,9 +1016,9 @@ template <class T>
class TCompactTrieTest::TDummyPacker: public TNullPacker<T> {
public:
static T Data(const TString&) {
- T data;
+ T data;
TNullPacker<T>().UnpackLeaf(nullptr, data);
- return data;
+ return data;
}
typedef T TData;
diff --git a/library/cpp/containers/comptrie/leaf_skipper.h b/library/cpp/containers/comptrie/leaf_skipper.h
index bd599ceaa2..3959258948 100644
--- a/library/cpp/containers/comptrie/leaf_skipper.h
+++ b/library/cpp/containers/comptrie/leaf_skipper.h
@@ -3,32 +3,32 @@
#include <cstddef>
namespace NCompactTrie {
- class ILeafSkipper {
- public:
- virtual size_t SkipLeaf(const char* p) const = 0;
+ class ILeafSkipper {
+ public:
+ virtual size_t SkipLeaf(const char* p) const = 0;
virtual ~ILeafSkipper() = default;
- };
-
+ };
+
template <class TPacker>
class TPackerLeafSkipper: public ILeafSkipper {
- private:
- const TPacker* Packer;
-
- public:
- TPackerLeafSkipper(const TPacker* packer)
- : Packer(packer)
- {
- }
-
+ private:
+ const TPacker* Packer;
+
+ public:
+ TPackerLeafSkipper(const TPacker* packer)
+ : Packer(packer)
+ {
+ }
+
size_t SkipLeaf(const char* p) const override {
- return Packer->SkipLeaf(p);
- }
+ return Packer->SkipLeaf(p);
+ }
// For test purposes.
const TPacker* GetPacker() const {
return Packer;
}
- };
+ };
// The data you need to traverse the trie without unpacking the values.
struct TOpaqueTrie {
diff --git a/library/cpp/containers/comptrie/opaque_trie_iterator.cpp b/library/cpp/containers/comptrie/opaque_trie_iterator.cpp
index 0f09b17f8e..5fd3914be6 100644
--- a/library/cpp/containers/comptrie/opaque_trie_iterator.cpp
+++ b/library/cpp/containers/comptrie/opaque_trie_iterator.cpp
@@ -168,7 +168,7 @@ namespace NCompactTrie {
}
//-------------------------------------------------------------------------
-
+
TFork::TFork(const char* data, size_t offset, size_t limit, const ILeafSkipper& skipper)
: Node(data, offset, skipper)
, Data(data)
diff --git a/library/cpp/containers/comptrie/protopacker.h b/library/cpp/containers/comptrie/protopacker.h
index 8349f83582..3e15866dc5 100644
--- a/library/cpp/containers/comptrie/protopacker.h
+++ b/library/cpp/containers/comptrie/protopacker.h
@@ -4,22 +4,22 @@
#include <util/ysaveload.h>
template <class Proto>
-class TProtoPacker {
+class TProtoPacker {
public:
TProtoPacker() = default;
- void UnpackLeaf(const char* p, Proto& entry) const {
+ void UnpackLeaf(const char* p, Proto& entry) const {
TMemoryInput in(p + sizeof(ui32), SkipLeaf(p) - sizeof(ui32));
entry.ParseFromArcadiaStream(&in);
}
- void PackLeaf(char* p, const Proto& entry, size_t size) const {
+ void PackLeaf(char* p, const Proto& entry, size_t size) const {
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 MeasureLeaf(const Proto& entry) const {
+ return entry.ByteSize() + sizeof(ui32);
+ }
size_t SkipLeaf(const char* p) const {
TMemoryInput in(p, sizeof(ui32));
ui32 size;