From 4ecef470e82c07c611044db777675e5205bede6d Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 1 May 2025 13:33:24 +0800 Subject: [PATCH] Code quality --- .../Storage/JsonStorage.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Storage/JsonStorage.cs b/Flow.Launcher.Infrastructure/Storage/JsonStorage.cs index db9ccc28a..c7eba05fd 100644 --- a/Flow.Launcher.Infrastructure/Storage/JsonStorage.cs +++ b/Flow.Launcher.Infrastructure/Storage/JsonStorage.cs @@ -52,17 +52,12 @@ namespace Flow.Launcher.Infrastructure.Storage public void Delete() { - if (File.Exists(FilePath)) + foreach (var path in new[] { FilePath, BackupFilePath, TempFilePath }) { - File.Delete(FilePath); - } - if (File.Exists(BackupFilePath)) - { - File.Delete(BackupFilePath); - } - if (File.Exists(TempFilePath)) - { - File.Delete(TempFilePath); + if (File.Exists(path)) + { + File.Delete(path); + } } }