From 595e7f6a6d2a252881581038ceeef01e03577585 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Fri, 21 Oct 2022 11:13:17 +0500 Subject: [PATCH] Replace 'if' with a ternary operator --- Boyfriend/Commands/SettingsCommand.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Boyfriend/Commands/SettingsCommand.cs b/Boyfriend/Commands/SettingsCommand.cs index 8738972..da71579 100644 --- a/Boyfriend/Commands/SettingsCommand.cs +++ b/Boyfriend/Commands/SettingsCommand.cs @@ -110,10 +110,9 @@ public sealed class SettingsCommand : ICommand { }; if (value is "reset" or "default") { - if (selectedSetting is "WelcomeMessage") - config[selectedSetting] = Messages.DefaultWelcomeMessage; - else - config[selectedSetting] = Boyfriend.DefaultConfig[selectedSetting]; + config[selectedSetting] = selectedSetting is "WelcomeMessage" + ? Messages.DefaultWelcomeMessage + : Boyfriend.DefaultConfig[selectedSetting]; } else { if (value == config[selectedSetting]) { cmd.Reply(string.Format(Messages.SettingsNothingChanged, localizedSelectedSetting, formattedValue),