util/IntrusiveList: fix swap() implementation if second list is empty
This commit is contained in:
@@ -270,6 +270,12 @@ public:
|
|||||||
a.head.prev->next = &a.head;
|
a.head.prev->next = &a.head;
|
||||||
|
|
||||||
b.head = {&b.head, &b.head};
|
b.head = {&b.head, &b.head};
|
||||||
|
} else if (b.empty()) {
|
||||||
|
b.head = a.head;
|
||||||
|
b.head.next->prev = &b.head;
|
||||||
|
b.head.prev->next = &b.head;
|
||||||
|
|
||||||
|
a.head = {&a.head, &a.head};
|
||||||
} else {
|
} else {
|
||||||
swap(a.head, b.head);
|
swap(a.head, b.head);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user