[gnome-shell] kbdA11yDialog: Avoid unnecessary ternary operators
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] kbdA11yDialog: Avoid unnecessary ternary operators
- Date: Wed, 11 Sep 2019 21:13:36 +0000 (UTC)
commit fc964f975a8e40e079698f6bae626e6580236f7d
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Aug 19 21:22:20 2019 +0200
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 26efbce0cb..ba3576599d 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");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]