Skip to content

Commit 137bfd6

Browse files
committed
Add comment about remove+set on LRU
1 parent 90ea034 commit 137bfd6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/reactor/cache.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export class LRUCache {
143143
hit(item) {
144144
const nextTick = this.tick + 1;
145145

146+
// if item exists, remove it first to reorder in lru OrderedMap
146147
const lru = this.cache.lookup(item) ?
147148
this.lru.remove(item).set(item, nextTick) :
148149
this.lru;

0 commit comments

Comments
 (0)