Skip to content

Commit

Permalink
Merge pull request #406 from RohitPaul0007/patch-49
Browse files Browse the repository at this point in the history
Update list.js
  • Loading branch information
rustedgrail authored Sep 11, 2023
2 parents fe2adae + ca207cb commit 96f1dd4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/data/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@

class List {
constructor() {
var sentinel = {};
let sentinel = {};
sentinel._next = sentinel._prev = sentinel;
this._sentinel = sentinel;
}

dequeue() {
var sentinel = this._sentinel;
var entry = sentinel._prev;
let sentinel = this._sentinel;
let entry = sentinel._prev;
if (entry !== sentinel) {
unlink(entry);
return entry;
}
}

enqueue(entry) {
var sentinel = this._sentinel;
let sentinel = this._sentinel;
if (entry._prev && entry._next) {
unlink(entry);
}
Expand All @@ -31,9 +31,9 @@ class List {
}

toString() {
var strs = [];
var sentinel = this._sentinel;
var curr = sentinel._prev;
let strs = [];
let sentinel = this._sentinel;
let curr = sentinel._prev;
while (curr !== sentinel) {
strs.push(JSON.stringify(curr, filterOutLinks));
curr = curr._prev;
Expand Down

0 comments on commit 96f1dd4

Please sign in to comment.