mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-19 00:00:43 +00:00
Fix issue with linked list remove (#7065)
* Added failing linked-list test for #7059 * Fixed linked-list remove bug #7059
This commit is contained in:
@@ -136,13 +136,9 @@ function _removeOne(list,value) {
|
||||
// we need to know if the FIRST value is the last in the list, not the last.
|
||||
if(next !== undefined) {
|
||||
if(typeof list.prev[next] === "object") {
|
||||
if(prev === undefined) {
|
||||
// Must have been first, and 'i' would be 0.
|
||||
list.prev[next].shift();
|
||||
} else {
|
||||
var i = list.prev[next].indexOf(value);
|
||||
list.prev[next][i] = prev;
|
||||
}
|
||||
// Nothing special needed for first since list.prev[next][0] will be 'undefined'
|
||||
var i = list.prev[next].indexOf(value);
|
||||
list.prev[next][i] = prev;
|
||||
} else {
|
||||
list.prev[next] = prev;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user