Parcourir la source

Fix List::move_before for front and back elements

sheepandshepherd il y a 10 ans
Parent
commit
db440a2a58
1 fichiers modifiés avec 8 ajouts et 2 suppressions
  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) {