Browse Source

Fixes List<T>::insert_before/after

Will Nations 7 năm trước cách đây
mục cha
commit
52f73a153d
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      core/list.h

+ 4 - 0
core/list.h

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