(uuid: string)
| 542 | } |
| 543 | |
| 544 | add(uuid: string): void { |
| 545 | if (this.set.has(uuid)) return |
| 546 | // Evict the entry at the current write position (if occupied) |
| 547 | const evicted = this.ring[this.writeIdx] |
| 548 | if (evicted !== undefined) { |
| 549 | this.set.delete(evicted) |
| 550 | } |
| 551 | this.ring[this.writeIdx] = uuid |
| 552 | this.set.add(uuid) |
| 553 | this.writeIdx = (this.writeIdx + 1) % this.capacity |
| 554 | } |
| 555 | |
| 556 | has(uuid: string): boolean { |
| 557 | return this.set.has(uuid) |
no test coverage detected