* Pushes element into array, keeping at most the most recent limit elements * * @param {!Array } array * @param {T} element * @param {number} limit * @template T
(array, element, limit)
| 91 | * @template T |
| 92 | */ |
| 93 | function pushLimit(array, element, limit) { |
| 94 | if (array.length >= limit) { |
| 95 | array.splice(0, array.length - limit + 1); |
| 96 | } |
| 97 | array.push(element); |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * A wrapper around our exponentialBackoff, to lazy initialize it to avoid an |
no test coverage detected