summaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/flat_hash
diff options
context:
space:
mode:
authorAlexey Bykov <[email protected]>2022-02-10 16:47:16 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:47:16 +0300
commitb50730a77e0c38f2fec0ad5d53fb2034d6470221 (patch)
tree9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/cpp/containers/flat_hash
parent4cadece7a57ab767e762a0bea1995a596aefeb11 (diff)
Restoring authorship annotation for Alexey Bykov <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/containers/flat_hash')
-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 5b9edeaa87c..82008f2f9cf 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 78fe5e11c05..2b9d6a1dc2a 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);