Merge pull request #2256 from sheepandshepherd/list-edits
List::move_before updates front/back pointers, fixes #2255
This commit is contained in:
commit
253d34b937
10
core/list.h
10
core/list.h
@ -518,10 +518,16 @@ public:
|
|||||||
|
|
||||||
if (value->prev_ptr) {
|
if (value->prev_ptr) {
|
||||||
value->prev_ptr->next_ptr = value->next_ptr;
|
value->prev_ptr->next_ptr = value->next_ptr;
|
||||||
};
|
}
|
||||||
|
else {
|
||||||
|
_data->first = value->next_ptr;
|
||||||
|
}
|
||||||
if (value->next_ptr) {
|
if (value->next_ptr) {
|
||||||
value->next_ptr->prev_ptr = value->prev_ptr;
|
value->next_ptr->prev_ptr = value->prev_ptr;
|
||||||
};
|
}
|
||||||
|
else {
|
||||||
|
_data->last = value->prev_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
value->next_ptr = where;
|
value->next_ptr = where;
|
||||||
if (!where) {
|
if (!where) {
|
||||||
|
Loading…
Reference in New Issue
Block a user