Fix List::move_before for front and back elements
This commit is contained in:
parent
f697ec2fe0
commit
db440a2a58
1 changed files with 8 additions and 2 deletions
10
core/list.h
10
core/list.h
|
@ -518,10 +518,16 @@ public:
|
|||
|
||||
if (value->prev_ptr) {
|
||||
value->prev_ptr->next_ptr = value->next_ptr;
|
||||
};
|
||||
}
|
||||
else {
|
||||
_data->first = value->next_ptr;
|
||||
}
|
||||
if (value->next_ptr) {
|
||||
value->next_ptr->prev_ptr = value->prev_ptr;
|
||||
};
|
||||
}
|
||||
else {
|
||||
_data->last = value->prev_ptr;
|
||||
}
|
||||
|
||||
value->next_ptr = where;
|
||||
if (!where) {
|
||||
|
|
Loading…
Reference in a new issue