repositories
/
poolifier.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
840270a
)
refactor: remove duplicate code in fixed-queue.ts
author
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Sat, 6 Jul 2024 23:33:17 +0000
(
01:33
+0200)
committer
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Sat, 6 Jul 2024 23:33:17 +0000
(
01:33
+0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/fixed-queue.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/fixed-queue.ts
b/src/fixed-queue.ts
index 42034e2fc887c34b461c7303f8049a2b0351d32f..e9003f70d8623804877170cb4cd9dc8c690a0163 100644
(file)
--- a/
src/fixed-queue.ts
+++ b/
src/fixed-queue.ts
@@
-21,16
+21,4
@@
export class FixedQueue<T>
this.nodeArray[index] = { data, priority: priority ?? 0 }
return ++this.size
}
-
- /** @inheritdoc */
- public get (index: number): T | undefined {
- if (this.empty() || index >= this.size) {
- return undefined
- }
- index += this.start
- if (index >= this.capacity) {
- index -= this.capacity
- }
- return this.nodeArray[index].data
- }
}