(uuid: string)
| 439 | } |
| 440 | |
| 441 | add(uuid: string): void { |
| 442 | if (this.set.has(uuid)) return |
| 443 | // Evict the entry at the current write position (if occupied) |
| 444 | const evicted = this.ring[this.writeIdx] |
| 445 | if (evicted !== undefined) { |
| 446 | this.set.delete(evicted) |
| 447 | } |
| 448 | this.ring[this.writeIdx] = uuid |
| 449 | this.set.add(uuid) |
| 450 | this.writeIdx = (this.writeIdx + 1) % this.capacity |
| 451 | } |
| 452 | |
| 453 | has(uuid: string): boolean { |
| 454 | return this.set.has(uuid) |
no test coverage detected