@param {T} event
(event)
| 84 | |
| 85 | /** @param {T} event */ |
| 86 | push(event) { |
| 87 | let time = event.time; |
| 88 | if (!this.isEmpty() && this.last().time > time) { |
| 89 | // Invalid insertion order, might happen without --single-process, |
| 90 | // finding insertion point. |
| 91 | let insertionPoint = this.find(time); |
| 92 | this._values.splice(insertionPoint, event); |
| 93 | } else { |
| 94 | this._values.push(event); |
| 95 | } |
| 96 | if (time > 0) { |
| 97 | this.endTime = Math.max(this.endTime, time); |
| 98 | if (this.startTime === 0) { |
| 99 | this.startTime = time; |
| 100 | } else { |
| 101 | this.startTime = Math.min(this.startTime, time); |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | /** @returns {T} */ |
| 107 | at(index) { |
no test coverage detected