repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test: add fixed priority queue get() test
[poolifier.git]
/
src
/
circular-buffer.ts
diff --git
a/src/circular-buffer.ts
b/src/circular-buffer.ts
index a56cd09d551e67cc865ac4e40950cb6988b76362..7abb982ea6adb3ebcd2881efbb9d1b7ef8c66682 100644
(file)
--- 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 {
* @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
}
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(
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) {
)
}
if (size < 0) {