diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/containers/top_keeper | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/containers/top_keeper')
4 files changed, 24 insertions, 24 deletions
diff --git a/library/cpp/containers/top_keeper/top_keeper.h b/library/cpp/containers/top_keeper/top_keeper.h index 362e430711..2f282b5a9e 100644 --- a/library/cpp/containers/top_keeper/top_keeper.h +++ b/library/cpp/containers/top_keeper/top_keeper.h @@ -179,13 +179,13 @@ public: } const T& GetNext() { - Y_ENSURE(!IsEmpty(), "Trying GetNext from empty heap!"); + Y_ENSURE(!IsEmpty(), "Trying GetNext from empty heap!"); Finalize(); return Internal.Back(); } void Pop() { - Y_ENSURE(!IsEmpty(), "Trying Pop from empty heap!"); + Y_ENSURE(!IsEmpty(), "Trying Pop from empty heap!"); Finalize(); Internal.Pop(); if (IsEmpty()) { @@ -194,7 +194,7 @@ public: } T ExtractOne() { - Y_ENSURE(!IsEmpty(), "Trying ExtractOne from empty heap!"); + Y_ENSURE(!IsEmpty(), "Trying ExtractOne from empty heap!"); Finalize(); auto value = std::move(Internal.Back()); Internal.Pop(); @@ -243,7 +243,7 @@ public: } void SetMaxSize(size_t newMaxSize) { - Y_ENSURE(!Finalized, "Cannot resize after finalizing (Pop() / GetNext() / Finalize())! " + Y_ENSURE(!Finalized, "Cannot resize after finalizing (Pop() / GetNext() / Finalize())! " "Use TLimitedHeap for this scenario"); MaxSize = newMaxSize; Internal.SetMaxSize(newMaxSize); diff --git a/library/cpp/containers/top_keeper/top_keeper/top_keeper.h b/library/cpp/containers/top_keeper/top_keeper/top_keeper.h index 362e430711..2f282b5a9e 100644 --- a/library/cpp/containers/top_keeper/top_keeper/top_keeper.h +++ b/library/cpp/containers/top_keeper/top_keeper/top_keeper.h @@ -179,13 +179,13 @@ public: } const T& GetNext() { - Y_ENSURE(!IsEmpty(), "Trying GetNext from empty heap!"); + Y_ENSURE(!IsEmpty(), "Trying GetNext from empty heap!"); Finalize(); return Internal.Back(); } void Pop() { - Y_ENSURE(!IsEmpty(), "Trying Pop from empty heap!"); + Y_ENSURE(!IsEmpty(), "Trying Pop from empty heap!"); Finalize(); Internal.Pop(); if (IsEmpty()) { @@ -194,7 +194,7 @@ public: } T ExtractOne() { - Y_ENSURE(!IsEmpty(), "Trying ExtractOne from empty heap!"); + Y_ENSURE(!IsEmpty(), "Trying ExtractOne from empty heap!"); Finalize(); auto value = std::move(Internal.Back()); Internal.Pop(); @@ -243,7 +243,7 @@ public: } void SetMaxSize(size_t newMaxSize) { - Y_ENSURE(!Finalized, "Cannot resize after finalizing (Pop() / GetNext() / Finalize())! " + Y_ENSURE(!Finalized, "Cannot resize after finalizing (Pop() / GetNext() / Finalize())! " "Use TLimitedHeap for this scenario"); MaxSize = newMaxSize; Internal.SetMaxSize(newMaxSize); diff --git a/library/cpp/containers/top_keeper/top_keeper/ut/top_keeper_ut.cpp b/library/cpp/containers/top_keeper/top_keeper/ut/top_keeper_ut.cpp index 5684a00377..a938279025 100644 --- a/library/cpp/containers/top_keeper/top_keeper/ut/top_keeper_ut.cpp +++ b/library/cpp/containers/top_keeper/top_keeper/ut/top_keeper_ut.cpp @@ -12,9 +12,9 @@ ui32 Rnd() { /* * Tests for TTopKeeper */ -Y_UNIT_TEST_SUITE(TTopKeeperTest) { +Y_UNIT_TEST_SUITE(TTopKeeperTest) { // Tests correctness on usual examples - Y_UNIT_TEST(CorrectnessTest) { + Y_UNIT_TEST(CorrectnessTest) { int m = 20000; TLimitedHeap<std::pair<int, int>> h1(m); @@ -40,7 +40,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } // Tests on zero-size correctness - Y_UNIT_TEST(ZeroSizeCorrectnes) { + Y_UNIT_TEST(ZeroSizeCorrectnes) { TTopKeeper<int> h(0); for (int i = 0; i < 100; ++i) { h.Insert(i % 10 + i / 10); @@ -50,7 +50,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } // Tests SetMaxSize behaviour - Y_UNIT_TEST(SetMaxSizeTest) { + Y_UNIT_TEST(SetMaxSizeTest) { int m = 20000; TLimitedHeap<int> h1(m); TTopKeeper<int> h2(m); @@ -77,7 +77,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } // Tests reuse behavior - Y_UNIT_TEST(ReuseTest) { + Y_UNIT_TEST(ReuseTest) { int m = 20000; TLimitedHeap<int> h1(m); TTopKeeper<int> h2(m); @@ -116,7 +116,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } // Tests reset behavior - Y_UNIT_TEST(ResetTest) { + Y_UNIT_TEST(ResetTest) { int m = 20000; TLimitedHeap<int> h1(m); TTopKeeper<int> h2(m); @@ -159,7 +159,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } } - Y_UNIT_TEST(PreRegressionTest) { + Y_UNIT_TEST(PreRegressionTest) { typedef std::pair<float, unsigned int> TElementType; const size_t randomTriesCount = 128; @@ -193,7 +193,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } } - Y_UNIT_TEST(CopyKeeperRegressionCase) { + Y_UNIT_TEST(CopyKeeperRegressionCase) { using TKeeper = TTopKeeper<float>; TVector<TKeeper> v(2, TKeeper(200)); auto& k = v[1]; diff --git a/library/cpp/containers/top_keeper/ut/top_keeper_ut.cpp b/library/cpp/containers/top_keeper/ut/top_keeper_ut.cpp index 5684a00377..a938279025 100644 --- a/library/cpp/containers/top_keeper/ut/top_keeper_ut.cpp +++ b/library/cpp/containers/top_keeper/ut/top_keeper_ut.cpp @@ -12,9 +12,9 @@ ui32 Rnd() { /* * Tests for TTopKeeper */ -Y_UNIT_TEST_SUITE(TTopKeeperTest) { +Y_UNIT_TEST_SUITE(TTopKeeperTest) { // Tests correctness on usual examples - Y_UNIT_TEST(CorrectnessTest) { + Y_UNIT_TEST(CorrectnessTest) { int m = 20000; TLimitedHeap<std::pair<int, int>> h1(m); @@ -40,7 +40,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } // Tests on zero-size correctness - Y_UNIT_TEST(ZeroSizeCorrectnes) { + Y_UNIT_TEST(ZeroSizeCorrectnes) { TTopKeeper<int> h(0); for (int i = 0; i < 100; ++i) { h.Insert(i % 10 + i / 10); @@ -50,7 +50,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } // Tests SetMaxSize behaviour - Y_UNIT_TEST(SetMaxSizeTest) { + Y_UNIT_TEST(SetMaxSizeTest) { int m = 20000; TLimitedHeap<int> h1(m); TTopKeeper<int> h2(m); @@ -77,7 +77,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } // Tests reuse behavior - Y_UNIT_TEST(ReuseTest) { + Y_UNIT_TEST(ReuseTest) { int m = 20000; TLimitedHeap<int> h1(m); TTopKeeper<int> h2(m); @@ -116,7 +116,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } // Tests reset behavior - Y_UNIT_TEST(ResetTest) { + Y_UNIT_TEST(ResetTest) { int m = 20000; TLimitedHeap<int> h1(m); TTopKeeper<int> h2(m); @@ -159,7 +159,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } } - Y_UNIT_TEST(PreRegressionTest) { + Y_UNIT_TEST(PreRegressionTest) { typedef std::pair<float, unsigned int> TElementType; const size_t randomTriesCount = 128; @@ -193,7 +193,7 @@ Y_UNIT_TEST_SUITE(TTopKeeperTest) { } } - Y_UNIT_TEST(CopyKeeperRegressionCase) { + Y_UNIT_TEST(CopyKeeperRegressionCase) { using TKeeper = TTopKeeper<float>; TVector<TKeeper> v(2, TKeeper(200)); auto& k = v[1]; |