lru: minor.
This commit is contained in:
parent
405feef9ce
commit
91ee6077b1
@ -122,8 +122,6 @@ class LRU {
|
|||||||
if (this.capacity === 0)
|
if (this.capacity === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
key = String(key);
|
|
||||||
|
|
||||||
let item = this.map.get(key);
|
let item = this.map.get(key);
|
||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
@ -158,8 +156,6 @@ class LRU {
|
|||||||
if (this.capacity === 0)
|
if (this.capacity === 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
key = String(key);
|
|
||||||
|
|
||||||
const item = this.map.get(key);
|
const item = this.map.get(key);
|
||||||
|
|
||||||
if (!item)
|
if (!item)
|
||||||
@ -180,7 +176,7 @@ class LRU {
|
|||||||
has(key) {
|
has(key) {
|
||||||
if (this.capacity === 0)
|
if (this.capacity === 0)
|
||||||
return false;
|
return false;
|
||||||
return this.map.has(String(key));
|
return this.map.has(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -193,8 +189,6 @@ class LRU {
|
|||||||
if (this.capacity === 0)
|
if (this.capacity === 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
key = String(key);
|
|
||||||
|
|
||||||
const item = this.map.get(key);
|
const item = this.map.get(key);
|
||||||
|
|
||||||
if (!item)
|
if (!item)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user