From 7aee4bbb6c3013b9549321d5d8b7bfd3d221e8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 29 Mar 2024 08:06:37 -0700 Subject: [PATCH] ternary operator and single item array --- src/Permissions/Widgets/AppSettingsView.vala | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Permissions/Widgets/AppSettingsView.vala b/src/Permissions/Widgets/AppSettingsView.vala index b0ae65ee..f72b2a54 100644 --- a/src/Permissions/Widgets/AppSettingsView.vala +++ b/src/Permissions/Widgets/AppSettingsView.vala @@ -141,13 +141,7 @@ public class Permissions.Widgets.AppSettingsView : Switchboard.SettingsPage { ); background_row.notify["active"].connect (() => { - string[] permissions = { }; - if (background_row.active) { - permissions += "yes"; - } else { - permissions += "no"; - } - + string[] permissions = { background_row.active ? "yes" : "no" }; permission_store.set_permission (BACKGROUND_TABLE, BACKGROUND_ID, selected_app.id, permissions); });