浏览代码

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) {