Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

bugfix for bug #7 #8

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/postman.js
Expand Up @@ -38,6 +38,14 @@
} else {
node.prev.next = node.next;
}
if (!node.next) {
this.last = node.prev;
if (this.last) {
this.last.next = null;
}
} else {
node.next.prev = node.prev;
}
return this.length--;
};
return LinkedList;
Expand Down
8 changes: 8 additions & 0 deletions src/postman.coffee
Expand Up @@ -31,6 +31,14 @@ class LinkedList
@first.prev = null
else
node.prev.next = node.next

if !node.next
@last = node.prev
if @last
@last.next = null
else
node.next.prev = node.prev

@length--

postie
Expand Down