aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/top_keeper/top_keeper.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/containers/top_keeper/top_keeper.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/containers/top_keeper/top_keeper.h')
-rw-r--r--library/cpp/containers/top_keeper/top_keeper.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/containers/top_keeper/top_keeper.h b/library/cpp/containers/top_keeper/top_keeper.h
index 2f282b5a9e..b5f901a86e 100644
--- a/library/cpp/containers/top_keeper/top_keeper.h
+++ b/library/cpp/containers/top_keeper/top_keeper.h
@@ -14,13 +14,13 @@ private:
size_t HalfMaxSize;
TComparator Comparer;
size_t MinElementIndex;
-
+
private:
void Reserve() {
Internal.reserve(2 * HalfMaxSize);
}
- template <class UT>
+ template <class UT>
bool Insert(UT&& value) noexcept {
if (Y_UNLIKELY(0 == HalfMaxSize)) {
return false;
@@ -55,7 +55,7 @@ private:
Reserve();
}
- template <class TAllocParam>
+ template <class TAllocParam>
TVectorWithMin(const size_t halfMaxSize, const TComparator& comp, TAllocParam&& param)
: Internal(std::forward<TAllocParam>(param))
, HalfMaxSize(halfMaxSize)
@@ -89,7 +89,7 @@ private:
return Insert(std::move(value));
}
- template <class... TArgs>
+ template <class... TArgs>
bool Emplace(TArgs&&... args) {
return Insert(T(std::forward<TArgs>(args)...)); // TODO: make it "real" emplace, not that fake one
}
@@ -133,7 +133,7 @@ private:
void CheckNotFinalized() {
Y_ENSURE(!Finalized, "Cannot insert after finalizing (Pop() / GetNext() / Finalize())! "
- "Use TLimitedHeap for this scenario");
+ "Use TLimitedHeap for this scenario");
}
size_t MaxSize;
@@ -158,7 +158,7 @@ public:
{
}
- template <class TAllocParam>
+ template <class TAllocParam>
TTopKeeper(size_t maxSize, const TComparator& comp, TAllocParam&& param)
: MaxSize(maxSize)
, Comparer(comp)
@@ -219,7 +219,7 @@ public:
return Internal.Push(std::move(value));
}
- template <class... TArgs>
+ template <class... TArgs>
bool Emplace(TArgs&&... args) {
CheckNotFinalized();
return Internal.Emplace(std::forward<TArgs>(args)...);
@@ -244,7 +244,7 @@ public:
void SetMaxSize(size_t newMaxSize) {
Y_ENSURE(!Finalized, "Cannot resize after finalizing (Pop() / GetNext() / Finalize())! "
- "Use TLimitedHeap for this scenario");
+ "Use TLimitedHeap for this scenario");
MaxSize = newMaxSize;
Internal.SetMaxSize(newMaxSize);
}