From 36d1028af1dc86788cabf03e680baf9ac6b13342 Mon Sep 17 00:00:00 2001 From: bobrosoft Date: Sun, 11 Aug 2019 15:46:08 +0200 Subject: [PATCH] ShellScriptTouchBarItem: performance optimization --- MTMR/ShellScriptTouchBarItem.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MTMR/ShellScriptTouchBarItem.swift b/MTMR/ShellScriptTouchBarItem.swift index 01dca4b..1228a97 100644 --- a/MTMR/ShellScriptTouchBarItem.swift +++ b/MTMR/ShellScriptTouchBarItem.swift @@ -42,7 +42,9 @@ class ShellScriptTouchBarItem: CustomButtonTouchBarItem { // Update UI DispatchQueue.main.async { [weak self, newBackgoundColor] in - self?.backgroundColor = newBackgoundColor + if (newBackgoundColor != self?.backgroundColor) { // performance optimization because of reinstallButton + self?.backgroundColor = newBackgoundColor + } self?.attributedTitle = title self?.forceHideConstraint.isActive = scriptResult == "" }