cached fetcher delete key
This commit is contained in:
parent
1645c2aabf
commit
1d3ab23ec4
@ -26,6 +26,10 @@ class LRUCache {
|
|||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete (key) {
|
||||||
|
this.cache.delete(key)
|
||||||
|
}
|
||||||
|
|
||||||
set (key, value) {
|
set (key, value) {
|
||||||
if (this.cache.has(key)) this.cache.delete(key)
|
if (this.cache.has(key)) this.cache.delete(key)
|
||||||
else if (this.cache.size >= this.maxSize) {
|
else if (this.cache.size >= this.maxSize) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user