repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: fix async task statistics accounting
[poolifier.git]
/
src
/
queue.ts
diff --git
a/src/queue.ts
b/src/queue.ts
index baecaa35b248d98a6cd4d378b444cfe2a4d316f2..ead4b6375388398483eda10abaaae50e2c779928 100644
(file)
--- a/
src/queue.ts
+++ b/
src/queue.ts
@@
-6,18
+6,15
@@
* @typeParam T - Type of queue items.
*/
export class Queue<T> {
* @typeParam T - Type of queue items.
*/
export class Queue<T> {
- private items: T[]
- private offset: number
- public size: number
- public maxSize: number
+ private items!: T[]
+ private offset!: number
+ /** The size of the queue. */
+ public size!: number
+ /** The maximum size of the queue. */
+ public maxSize!: number
public constructor () {
public constructor () {
- this.items = []
- this.offset = 0
- /** The size of the queue. */
- this.size = 0
- /** The maximum size of the queue. */
- this.maxSize = 0
+ this.clear()
}
/**
}
/**
@@
-54,7
+51,7
@@
export class Queue<T> {
}
/**
}
/**
- * Peek at the first item.
+ * Peek
s
at the first item.
*
* @returns The first item or `undefined` if the queue is empty.
*/
*
* @returns The first item or `undefined` if the queue is empty.
*/
@@
-66,7
+63,7
@@
export class Queue<T> {
}
/**
}
/**
- * Clear the queue.
+ * Clear
s
the queue.
*/
public clear (): void {
this.items = []
*/
public clear (): void {
this.items = []