mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
pow-testgiver support
This commit is contained in:
parent
dbde9c1c40
commit
f064b1047a
257 changed files with 6665 additions and 2608 deletions
|
@ -40,19 +40,19 @@ struct ListNode {
|
|||
if (other.empty()) {
|
||||
clear();
|
||||
} else {
|
||||
ListNode *head = other.prev;
|
||||
other.remove();
|
||||
head->put(this);
|
||||
init_from(std::move(other));
|
||||
}
|
||||
}
|
||||
|
||||
ListNode &operator=(ListNode &&other) {
|
||||
if (this == &other) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
this->remove();
|
||||
|
||||
if (!other.empty()) {
|
||||
ListNode *head = other.prev;
|
||||
other.remove();
|
||||
head->put(this);
|
||||
init_from(std::move(other));
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
@ -70,11 +70,12 @@ struct ListNode {
|
|||
}
|
||||
|
||||
void put(ListNode *other) {
|
||||
other->connect(next);
|
||||
this->connect(other);
|
||||
DCHECK(other->empty());
|
||||
put_unsafe(other);
|
||||
}
|
||||
|
||||
void put_back(ListNode *other) {
|
||||
DCHECK(other->empty());
|
||||
prev->connect(other);
|
||||
other->connect(this);
|
||||
}
|
||||
|
@ -94,11 +95,35 @@ struct ListNode {
|
|||
return next == this;
|
||||
}
|
||||
|
||||
private:
|
||||
ListNode *begin() {
|
||||
return next;
|
||||
}
|
||||
ListNode *end() {
|
||||
return this;
|
||||
}
|
||||
ListNode *get_next() {
|
||||
return next;
|
||||
}
|
||||
ListNode *get_prev() {
|
||||
return prev;
|
||||
}
|
||||
|
||||
protected:
|
||||
void clear() {
|
||||
next = this;
|
||||
prev = this;
|
||||
}
|
||||
|
||||
void init_from(ListNode &&other) {
|
||||
ListNode *head = other.prev;
|
||||
other.remove();
|
||||
head->put_unsafe(this);
|
||||
}
|
||||
|
||||
void put_unsafe(ListNode *other) {
|
||||
other->connect(next);
|
||||
this->connect(other);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace td
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue