From 896a162f5591f632ed457aa3a34335460755eb68 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Tue, 14 Jan 2020 22:52:49 -0500 Subject: Improve readability --- editors/code/src/config.ts | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'editors') diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index c6d5fc4af..fc21c8813 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -174,22 +174,19 @@ export class Config { requireReloadMessage = 'Changing cargo features requires a reload'; } this.prevCargoFeatures = { ...this.cargoFeatures }; - - if ( - this.prevCargoWatchOptions !== null && - (this.cargoWatchOptions.enable !== - this.prevCargoWatchOptions.enable || - this.cargoWatchOptions.command !== - this.prevCargoWatchOptions.command || - this.cargoWatchOptions.allTargets !== - this.prevCargoWatchOptions.allTargets || - this.cargoWatchOptions.arguments.length !== - this.prevCargoWatchOptions.arguments.length || + + if (this.prevCargoWatchOptions !== null) { + const changed = + this.cargoWatchOptions.enable !== this.prevCargoWatchOptions.enable || + this.cargoWatchOptions.command !== this.prevCargoWatchOptions.command || + this.cargoWatchOptions.allTargets !== this.prevCargoWatchOptions.allTargets || + this.cargoWatchOptions.arguments.length !== this.prevCargoWatchOptions.arguments.length || this.cargoWatchOptions.arguments.some( (v, i) => v !== this.prevCargoWatchOptions!.arguments[i], - )) - ) { - requireReloadMessage = 'Changing cargo-watch options requires a reload'; + ); + if (changed) { + requireReloadMessage = 'Changing cargo-watch options requires a reload'; + } } this.prevCargoWatchOptions = { ...this.cargoWatchOptions }; -- cgit v1.2.3