Merge pull request #13143 from willnationsdev/list-insert-before-after-fix

Fixes List<T>::insert_before/after
This commit is contained in:
Rémi Verschelde 2017-11-22 18:18:25 +01:00 committed by GitHub
commit ba891a0e8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -306,6 +306,8 @@ public:
if (!p_element->next_ptr) { if (!p_element->next_ptr) {
_data->last = n; _data->last = n;
} else {
p_element->next_ptr->prev_ptr = n;
} }
p_element->next_ptr = n; p_element->next_ptr = n;
@ -330,6 +332,8 @@ public:
if (!p_element->prev_ptr) { if (!p_element->prev_ptr) {
_data->first = n; _data->first = n;
} else {
p_element->prev_ptr->next_ptr = n;
} }
p_element->prev_ptr = n; p_element->prev_ptr = n;