From 404f9c66b174493d7d75bf530cb8ec520aa22285 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 2 Apr 2021 00:25:02 +0200 Subject: [PATCH] Avoid a useless branching. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Bootstrap.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; } -- 2.34.1