From: Jérôme Benoit Date: Thu, 1 Apr 2021 22:25:02 +0000 (+0200) Subject: Avoid a useless branching. X-Git-Tag: v1.0.1-0~67 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=404f9c66b174493d7d75bf530cb8ec520aa22285;p=e-mobility-charging-stations-simulator.git Avoid a useless branching. Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 503c6bd2..ddf21f48 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -64,11 +64,9 @@ export default class Bootstrap { public async stop(): Promise { if (isMainThread && this.started) { - if (this.getWorkerImplementationInstance()) { - await this.getWorkerImplementationInstance().stop(); - // Nullify to force worker implementation instance creation - this.workerImplementationInstance = null; - } + await this.getWorkerImplementationInstance().stop(); + // Nullify to force worker implementation instance creation + this.workerImplementationInstance = null; } this.started = false; }