From: Jérôme Benoit Date: Sun, 10 Sep 2023 16:53:11 +0000 (+0200) Subject: perf: optimize condition checks order X-Git-Tag: v2.6.45~35 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b6bfca0158affbf4bdc0106a7b400eb9f7b73894;p=poolifier.git perf: optimize condition checks order Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 3dcbceab..6457b155 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1071,8 +1071,8 @@ export abstract class AbstractPool< this.emitter?.emit(PoolEvents.error, error) if ( this.opts.restartWorkerOnError === true && - !this.starting && - this.started + this.started && + !this.starting ) { if (workerInfo.dynamic) { this.createAndSetupDynamicWorkerNode()