We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6abbc70 commit 6a9fcd0Copy full SHA for 6a9fcd0
src/circular-buffer.ts
@@ -94,9 +94,10 @@ export class CircularBuffer {
94
if (this.empty()) {
95
return []
96
}
97
- const array: number[] = new Array<number>(this.size)
+ const size = this.size
98
+ const array: number[] = new Array<number>(size)
99
let currentIdx = this.readIdx
- for (let i = 0; i < this.size; i++) {
100
+ for (let i = 0; i < size; i++) {
101
array[i] = this.items[currentIdx]
102
currentIdx = currentIdx === this.maxArrayIdx ? 0 : currentIdx + 1
103
0 commit comments