From fc964f975a8e40e079698f6bae626e6580236f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 19 Aug 2019 21:22:20 +0200 Subject: [PATCH] kbdA11yDialog: Avoid unnecessary ternary operators A condition is already boolean, there's no point in explicitly turning it into true/false. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/710 --- js/ui/kbdA11yDialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ui/kbdA11yDialog.js b/js/ui/kbdA11yDialog.js index 26efbce0c..ba3576599 100644 --- a/js/ui/kbdA11yDialog.js +++ b/js/ui/kbdA11yDialog.js @@ -27,7 +27,7 @@ class KbdA11yDialog extends GObject.Object { if (whatChanged & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) { key = KEY_SLOW_KEYS_ENABLED; - enabled = (newFlags & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) ? true : false; + enabled = (newFlags & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) > 0; title = enabled ? _("Slow Keys Turned On") : _("Slow Keys Turned Off"); @@ -36,7 +36,7 @@ class KbdA11yDialog extends GObject.Object { } else if (whatChanged & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) { key = KEY_STICKY_KEYS_ENABLED; - enabled = (newFlags & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) ? true : false; + enabled = (newFlags & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) > 0; title = enabled ? _("Sticky Keys Turned On") : _("Sticky Keys Turned Off");