fixed getNext & getPrev

This commit is contained in:
Kevin Jahns
2015-04-24 13:52:17 +02:00
parent 0a89150fab
commit 729d7ed3aa
11 changed files with 196 additions and 69 deletions

View File

@@ -391,12 +391,15 @@ module.exports = function() {
i = 1;
}
n = this;
while (i > 0 && n.is_deleted && (n.next_cl != null)) {
while (i > 0 && (n.next_cl != null)) {
n = n.next_cl;
if (!n.is_deleted) {
i--;
}
}
if (n.is_deleted) {
null;
}
return n;
};
@@ -406,13 +409,17 @@ module.exports = function() {
i = 1;
}
n = this;
while (i > 0 && n.is_deleted && (n.prev_cl != null)) {
while (i > 0 && (n.prev_cl != null)) {
n = n.prev_cl;
if (!n.is_deleted) {
i--;
}
}
return n;
if (n.is_deleted) {
return null;
} else {
return n;
}
};
Insert.prototype.applyDelete = function(o) {