Skip to content

Commit

Permalink
Fix JSLint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Devin Torres committed Oct 22, 2010
1 parent e08d103 commit 08a468e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/winked.js
Expand Up @@ -32,18 +32,20 @@ LinkedList.prototype = {
}

if (idx < 0) idx = len + idx;

var node;
if (idx < len/2) {
var node = this.head,
nextNode = node.next;
node = this.head;
var nextNode = node.next;
while (idx--) {
node = nextNode;
nextNode = node.next;
}
return node;
} else {
var node = this.tail,
prevNode = node.prev,
idx = len - idx - 1
node = this.tail;
var prevNode = node.prev;
idx = len - idx - 1;
while (idx--) {
node = prevNode;
prevNode = node.prev;
Expand Down Expand Up @@ -379,6 +381,7 @@ LinkedList.prototype.swap = LinkedList.prototype.replace;
LinkedList.prototype.index = LinkedList.prototype.indexOf;
LinkedList.prototype.count = LinkedList.prototype.size;

var exports = exports || {};
exports.LinkedList = LinkedList;
exports.Node = Node;
if (exports) {
exports.LinkedList = LinkedList;
exports.Node = Node;
}

0 comments on commit 08a468e

Please sign in to comment.