Permalink
Browse files

Manage tail and head properly, fix '_length' typo

  • Loading branch information...
isaacs committed Nov 22, 2011
1 parent 3ea2852 commit 70c57d10c1055917fe8968a4c94a38f47f5fcbfd
Showing with 3 additions and 3 deletions.
  1. +3 −3 fast-list.js
View
@@ -30,7 +30,7 @@ FastList.prototype =
}
this.length --
if (this.length === 1) this._head = this._tail
else if (this.length === 0) this._head = null
else if (this.length === 0) this._head = this._tail = null
return t.data
}
, unshift: function (data) {
@@ -39,15 +39,15 @@ FastList.prototype =
this.length ++
}
, shift: function () {
if (this._length === 0) return undefined
if (this.length === 0) return undefined
var h = this._head
this._head = h.next
if (h.next) {
h.next = this._head.prev = null
}
this.length --
if (this.length === 1) this._tail = this._head
else if (this.length === 0) this._tail = null
else if (this.length === 0) this._head = this._tail = null
return h.data
}
, item: function (n) {

0 comments on commit 70c57d1

Please sign in to comment.