aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers
diff options
context:
space:
mode:
authorAlexey Bykov <alexei4203@yandex.ru>2022-02-10 16:47:16 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:16 +0300
commit4cadece7a57ab767e762a0bea1995a596aefeb11 (patch)
tree7649c16cf4b52e994709f6c9e1716c993ca28759 /library/cpp/containers
parent143876304996506751ade0b80b3c47f188b9834f (diff)
downloadydb-4cadece7a57ab767e762a0bea1995a596aefeb11.tar.gz
Restoring authorship annotation for Alexey Bykov <alexei4203@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/containers')
-rw-r--r--library/cpp/containers/flat_hash/lib/containers.h34
-rw-r--r--library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp32
2 files changed, 33 insertions, 33 deletions
diff --git a/library/cpp/containers/flat_hash/lib/containers.h b/library/cpp/containers/flat_hash/lib/containers.h
index 82008f2f9c..5b9edeaa87 100644
--- a/library/cpp/containers/flat_hash/lib/containers.h
+++ b/library/cpp/containers/flat_hash/lib/containers.h
@@ -40,23 +40,23 @@ private:
TCage(TCage&&) = default;
TCage& operator=(const TCage& rhs) {
- switch (rhs.Status_) {
- case NS_TAKEN:
- if constexpr (std::is_copy_assignable_v<value_type>) {
- Value_ = rhs.Value_;
- } else {
- Value_.emplace(rhs.Value());
- }
- break;
- case NS_EMPTY:
- case NS_DELETED:
- if (Value_.has_value()) {
- Value_.reset();
- }
- break;
- default:
- Y_VERIFY(false, "Not implemented");
- }
+ switch (rhs.Status_) {
+ case NS_TAKEN:
+ if constexpr (std::is_copy_assignable_v<value_type>) {
+ Value_ = rhs.Value_;
+ } else {
+ Value_.emplace(rhs.Value());
+ }
+ break;
+ case NS_EMPTY:
+ case NS_DELETED:
+ if (Value_.has_value()) {
+ Value_.reset();
+ }
+ break;
+ default:
+ Y_VERIFY(false, "Not implemented");
+ }
Status_ = rhs.Status_;
return *this;
}
diff --git a/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp b/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp
index 2b9d6a1dc2..78fe5e11c0 100644
--- a/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp
+++ b/library/cpp/containers/flat_hash/ut/flat_hash_ut.cpp
@@ -63,21 +63,21 @@ class TMapTest : public TTestBase {
UNIT_ASSERT(!st2.empty());
}
- void DoubleCopyAssignmentTest() {
- Map st(MAP_INPUT_SAMPLE);
- Map st2;
- UNIT_ASSERT_UNEQUAL(st, st2);
- UNIT_ASSERT(st2.empty());
-
- st2 = st;
- UNIT_ASSERT_EQUAL(st, st2);
- UNIT_ASSERT(!st2.empty());
-
- st2 = st;
- UNIT_ASSERT_EQUAL(st, st2);
- UNIT_ASSERT(!st2.empty());
- }
-
+ void DoubleCopyAssignmentTest() {
+ Map st(MAP_INPUT_SAMPLE);
+ Map st2;
+ UNIT_ASSERT_UNEQUAL(st, st2);
+ UNIT_ASSERT(st2.empty());
+
+ st2 = st;
+ UNIT_ASSERT_EQUAL(st, st2);
+ UNIT_ASSERT(!st2.empty());
+
+ st2 = st;
+ UNIT_ASSERT_EQUAL(st, st2);
+ UNIT_ASSERT(!st2.empty());
+ }
+
void MoveAssignmentTest() {
Map st(MAP_INPUT_SAMPLE);
Map st2;
@@ -128,7 +128,7 @@ class TMapTest : public TTestBase {
UNIT_TEST(CopyConstructionTest);
UNIT_TEST(MoveConstructionTest);
UNIT_TEST(CopyAssignmentTest);
- UNIT_TEST(DoubleCopyAssignmentTest);
+ UNIT_TEST(DoubleCopyAssignmentTest);
UNIT_TEST(MoveAssignmentTest);
UNIT_TEST(InsertOrAssignTest);
UNIT_TEST(TryEmplaceTest);