Skip to content

Commit

Permalink
Fixing assignment of right for of old left
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Dec 12, 2018
1 parent 10e4f25 commit 157a61a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions lib/tiny-lru.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright 2018
* @license BSD-3-Clause
* @link https://github.com/avoidwork/tiny-lru
* @version 5.0.1
* @version 5.0.2
*/
"use strict";

Expand Down Expand Up @@ -108,13 +108,13 @@
}

if (r !== empty) {
if (l !== empty) {
this.cache[l].right = r;
}

this.cache[r].left = l;
}

if (l !== empty) {
this.cache[l].right = r;
}

if (this.last === key) {
this.last = r;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/tiny-lru.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/tiny-lru.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tiny-lru",
"description": "Tiny LRU cache for Client or Server",
"version": "5.0.1",
"version": "5.0.2",
"homepage": "https://github.com/avoidwork/tiny-lru",
"author": "Jason Mulligan <jason.mulligan@avoidwork.com>",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions src/lru.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@
}

if (r !== empty) {
if (l !== empty) {
this.cache[l].right = r;
}

this.cache[r].left = l;
}

if (l !== empty) {
this.cache[l].right = r;
}

if (this.last === key) {
this.last = r;
}
Expand Down

0 comments on commit 157a61a

Please sign in to comment.