From cd0f49d83dfe529f74f819e23de6db6a71d3713d Mon Sep 17 00:00:00 2001 From: HolographicHat <58809250+HolographicHat@users.noreply.github.com> Date: Tue, 6 Feb 2024 23:19:41 +0800 Subject: [PATCH] shorten code --- src/Program.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Program.cs b/src/Program.cs index c69b1d7..5af746d 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -39,13 +39,9 @@ try { if (historyCache.LastWriteTime.AddMinutes(60) > DateTime.UtcNow && data != null) { Console.WriteLine(App.UsePreviousData); - var text = Console.ReadLine(); - if (text != null) { - text = text.ToUpper(); - if (text == "Y" || text == "YES") { - Export.Choose(data); - return; - } + if (Console.ReadLine()?.ToUpper() is "Y" or "YES") { + Export.Choose(data); + return; } } @@ -56,4 +52,4 @@ StartAndWaitResult(AppConfig.GamePath, str => { historyCache.Write(bytes); Export.Choose(list); return true; -}); \ No newline at end of file +});