Skip to content

Commit

Permalink
Upgrading LRU, simplifying blacklist()
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Mar 29, 2018
1 parent 2489b98 commit 2ff1021
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions lib/woodland.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ class Woodland {
}

blacklist (fn) {
if (this.blacklisted.has(fn.hash) === false) {
this.blacklisted.add(fn.hash);
}
this.blacklisted.add(fn.hash);

return this;
}
Expand Down Expand Up @@ -356,7 +354,7 @@ class Woodland {
}

routes (uri, method, override = false) {
const key = this.hash(method + delimiter + uri),
const key = `${method}${delimiter}${uri}`,
cached = override === false ? this.cache.get(key) : void 0;
let result;

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "woodland",
"version": "4.3.9",
"version": "4.3.10",
"description": "Lightweight HTTP/HTTPS/HTTP2 router with automatic `Allow` & `CORS` headers",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"murmurhash3js": "^3.0.1",
"tiny-coerce": "^1.0.1",
"tiny-lru": "^1.5.1",
"tiny-lru": "^1.5.2",
"tiny-parse": "^2.1.2"
},
"devDependencies": {
Expand Down

0 comments on commit 2ff1021

Please sign in to comment.