Преглед изворни кода

Fix List::move_before for front and back elements

sheepandshepherd пре 10 година
родитељ
комит
db440a2a58
1 измењених фајлова са 8 додато и 2 уклоњено
  1. 8 2
      core/list.h

+ 8 - 2
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) {