(item: T)
| 72 | } |
| 73 | |
| 74 | push(item: T): void { |
| 75 | this.buffer[this.tail] = item; |
| 76 | this.tail = (this.tail + 1) % this.capacity; |
| 77 | if (this.size < this.capacity) { |
| 78 | this.size++; |
| 79 | } else { |
| 80 | this.head = (this.head + 1) % this.capacity; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | toArray(): T[] { |
| 85 | const result: T[] = []; |
no outgoing calls
no test coverage detected