X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcircular-buffer.ts;h=7abb982ea6adb3ebcd2881efbb9d1b7ef8c66682;hb=f45a8925025d4b76849ea359542bb6bafd39695d;hp=a56cd09d551e67cc865ac4e40950cb6988b76362;hpb=0cd1f28c613a876bfedd3b70b987e37f91888ed0;p=poolifier.git diff --git a/src/circular-buffer.ts b/src/circular-buffer.ts index a56cd09d..7abb982e 100644 --- a/src/circular-buffer.ts +++ b/src/circular-buffer.ts @@ -65,14 +65,14 @@ export class CircularBuffer { * @returns Number from buffer. */ public get (): number | undefined { - const data = this.items[this.readIdx] - if (data === -1) { + const number = this.items[this.readIdx] + if (number === -1) { return } this.items[this.readIdx] = -1 this.readIdx = this.readIdx === this.maxArrayIdx ? 0 : this.readIdx + 1 --this.size - return data + return number } /** @@ -87,7 +87,7 @@ export class CircularBuffer { private checkSize (size: number): void { if (!Number.isSafeInteger(size)) { throw new TypeError( - `Invalid circular buffer size: ${size} is not an integer` + `Invalid circular buffer size: '${size}' is not an integer` ) } if (size < 0) {