From f8178a66ad86f0107de62634f610a3e9a9ed192d Mon Sep 17 00:00:00 2001
From: Patrizio Bekerle <patrizio@bekerle.com>
Date: Tue, 26 May 2020 13:39:49 +0200
Subject: [PATCH] Refactor variable assignment

---
 src/textswitch.js | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/textswitch.js b/src/textswitch.js
index 3066a12..4e03c27 100644
--- a/src/textswitch.js
+++ b/src/textswitch.js
@@ -63,11 +63,7 @@ export class TextSwitch extends LitElement {
     }
 
     update(changedProperties) {
-        if (this._active === BUTTON1) {
-            this.name = this.name1;
-        } else {
-            this.name = this.name2;
-        }
+        this.name = this._active === BUTTON1 ? this.name1 : this.name2;
 
         changedProperties.forEach((oldValue, propName) => {
             if (propName === "name") {
-- 
GitLab