repositories
/
poolifier.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a5fb94
)
Simplify worker choosing (#138)
author
Jérôme Benoit
<jerome.benoit@sap.com>
Sat, 13 Feb 2021 10:40:47 +0000
(11:40 +0100)
committer
GitHub
<noreply@github.com>
Sat, 13 Feb 2021 10:40:47 +0000
(11:40 +0100)
src/pools/abstract-pool.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/pools/abstract-pool.ts
b/src/pools/abstract-pool.ts
index 1ae188dd53cb2f194e586a0c82087db7f9ed1dc8..1ccaca8b207c613359265eb757d74dffc8c47176 100644
(file)
--- a/
src/pools/abstract-pool.ts
+++ b/
src/pools/abstract-pool.ts
@@
-150,13
+150,9
@@
export abstract class AbstractPool<
}
protected chooseWorker (): Worker {
- if (this.workers.length - 1 === this.nextWorker) {
- this.nextWorker = 0
- return this.workers[this.nextWorker]
- } else {
- this.nextWorker++
- return this.workers[this.nextWorker]
- }
+ this.nextWorker =
+ this.nextWorker === this.workers.length - 1 ? 0 : this.nextWorker + 1
+ return this.workers[this.nextWorker]
}
protected abstract newWorker (): Worker