aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading
diff options
context:
space:
mode:
authorsskvor <sskvor@yandex-team.ru>2022-02-10 16:48:04 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:04 +0300
commit75abffb472365d28bd0a019db1a54cb32a6100dd (patch)
tree09a7f042da3da3e074e6dd6f7e5305a92eb2321a /library/cpp/threading
parentb228f91bb45c3cb95fcd861c424bb3de0fd356f2 (diff)
downloadydb-75abffb472365d28bd0a019db1a54cb32a6100dd.tar.gz
Restoring authorship annotation for <sskvor@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/threading')
-rw-r--r--library/cpp/threading/skip_list/skiplist.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/threading/skip_list/skiplist.h b/library/cpp/threading/skip_list/skiplist.h
index 914a7c6ee7..03c6a33928 100644
--- a/library/cpp/threading/skip_list/skiplist.h
+++ b/library/cpp/threading/skip_list/skiplist.h
@@ -78,8 +78,8 @@ namespace NThreading {
TNode* Next[]; // variable-size array maximum of MaxHeight values
public:
- TNode(T&& value)
- : Value(std::move(value))
+ TNode(T&& value)
+ : Value(std::move(value))
{
Y_UNUSED(Next);
}
@@ -192,13 +192,13 @@ namespace NThreading {
Init();
}
- bool Insert(T value) {
+ bool Insert(T value) {
TNode* node = PrepareInsert(value);
if (Y_UNLIKELY(node && Compare(node, value) == 0)) {
// we do not allow duplicates
return false;
}
- node = DoInsert(std::move(value));
+ node = DoInsert(std::move(value));
TCounter::OnInsert(node->GetValue());
return true;
}
@@ -277,11 +277,11 @@ namespace NThreading {
return static_cast<TNode*>(buffer);
}
- TNode* AllocateNode(T&& value, int height) {
+ TNode* AllocateNode(T&& value, int height) {
size_t size = sizeof(TNode) + sizeof(TNode*) * height;
void* buffer = Allocator.Allocate(size);
memset(buffer, 0, size);
- return new (buffer) TNode(std::move(value));
+ return new (buffer) TNode(std::move(value));
}
TNode* FindFirst() const {
@@ -382,7 +382,7 @@ namespace NThreading {
return next;
}
- TNode* DoInsert(T&& value) {
+ TNode* DoInsert(T&& value) {
// choose level to place new node
int currentHeight = AtomicGet(Height);
int height = RandomHeight();
@@ -394,7 +394,7 @@ namespace NThreading {
AtomicSet(Height, height);
}
- TNode* node = AllocateNode(std::move(value), height);
+ TNode* node = AllocateNode(std::move(value), height);
node->Link(height, Prev);
// keep last inserted node to optimize sequential inserts