aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/packers
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.ru>2022-02-10 16:45:12 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:12 +0300
commit49116032d905455a7b1c994e4a696afc885c1e71 (patch)
treebe835aa92c6248212e705f25388ebafcf84bc7a1 /library/cpp/packers
parent4e839db24a3bbc9f1c610c43d6faaaa99824dcca (diff)
downloadydb-49116032d905455a7b1c994e4a696afc885c1e71.tar.gz
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/packers')
-rw-r--r--library/cpp/packers/region_packer.h10
-rw-r--r--library/cpp/packers/ut/proto_packer_ut.cpp2
-rw-r--r--library/cpp/packers/ut/region_packer_ut.cpp8
3 files changed, 10 insertions, 10 deletions
diff --git a/library/cpp/packers/region_packer.h b/library/cpp/packers/region_packer.h
index c0470fcf48..2c661cb5bc 100644
--- a/library/cpp/packers/region_packer.h
+++ b/library/cpp/packers/region_packer.h
@@ -2,7 +2,7 @@
#include "packers.h"
-#include <util/generic/array_ref.h>
+#include <util/generic/array_ref.h>
// Stores an array of PODs in the trie (copying them with memcpy).
// Byte order and alignment are your problem.
@@ -10,7 +10,7 @@
template <class TRecord>
class TRegionPacker {
public:
- typedef TArrayRef<TRecord> TRecords;
+ typedef TArrayRef<TRecord> TRecords;
void UnpackLeaf(const char* p, TRecords& result) const {
size_t len;
@@ -20,15 +20,15 @@ public:
}
void PackLeaf(char* buf, const TRecords& data, size_t computedSize) const {
- size_t len = data.size();
+ size_t len = data.size();
size_t lenChar = len * sizeof(TRecord);
size_t start = computedSize - lenChar;
NPackers::TIntegralPacker<size_t>().PackLeaf(buf, len, NPackers::TIntegralPacker<size_t>().MeasureLeaf(len));
- memcpy(buf + start, data.data(), lenChar);
+ memcpy(buf + start, data.data(), lenChar);
}
size_t MeasureLeaf(const TRecords& data) const {
- size_t len = data.size();
+ size_t len = data.size();
return NPackers::TIntegralPacker<size_t>().MeasureLeaf(len) + len * sizeof(TRecord);
}
diff --git a/library/cpp/packers/ut/proto_packer_ut.cpp b/library/cpp/packers/ut/proto_packer_ut.cpp
index a60610b52b..e4151ba68c 100644
--- a/library/cpp/packers/ut/proto_packer_ut.cpp
+++ b/library/cpp/packers/ut/proto_packer_ut.cpp
@@ -25,7 +25,7 @@ void FillRepeatedFields(TTestMessage& msg) {
}
}
-// do not want to use google/protobuf/util/message_differencer because of warnings
+// do not want to use google/protobuf/util/message_differencer because of warnings
bool operator==(const TTestMessage& lhs, const TTestMessage& rhs) {
if (lhs.GetRequiredString() != rhs.GetRequiredString() ||
lhs.GetRequiredInt32() != rhs.GetRequiredInt32() ||
diff --git a/library/cpp/packers/ut/region_packer_ut.cpp b/library/cpp/packers/ut/region_packer_ut.cpp
index 37f05f327a..0cb08ccf65 100644
--- a/library/cpp/packers/ut/region_packer_ut.cpp
+++ b/library/cpp/packers/ut/region_packer_ut.cpp
@@ -8,7 +8,7 @@ void TestPacker() {
TRegionPacker<TValue> p;
- using TValues = TArrayRef<TValue>;
+ using TValues = TArrayRef<TValue>;
TValues valueRegion = TValues(values, Y_ARRAY_SIZE(values));
size_t sz = p.MeasureLeaf(valueRegion);
UNIT_ASSERT_VALUES_EQUAL(sz, 1 + sizeof(values));
@@ -18,9 +18,9 @@ void TestPacker() {
UNIT_ASSERT_VALUES_EQUAL(buffer[0], 4);
p.UnpackLeaf(buffer.data(), valueRegion);
- UNIT_ASSERT_EQUAL(valueRegion.data(), (const TValue*)(buffer.begin() + 1));
- UNIT_ASSERT_EQUAL(valueRegion.size(), Y_ARRAY_SIZE(values));
- UNIT_ASSERT_EQUAL(0, memcmp(values, valueRegion.data(), sizeof(values)));
+ UNIT_ASSERT_EQUAL(valueRegion.data(), (const TValue*)(buffer.begin() + 1));
+ UNIT_ASSERT_EQUAL(valueRegion.size(), Y_ARRAY_SIZE(values));
+ UNIT_ASSERT_EQUAL(0, memcmp(values, valueRegion.data(), sizeof(values)));
}
Y_UNIT_TEST_SUITE(RegionPacker) {