Skip to content

Commit 54b35d1

Browse files
committed
Improve code quality
1 parent b475396 commit 54b35d1

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class Main : ISettingProvider, IPlugin, IAsyncReloadable, IPluginI18n, IC
2222
private FaviconService _faviconService = null!;
2323
private BookmarkWatcherService _bookmarkWatcher = null!;
2424

25-
private List<Bookmark> _bookmarks = new();
25+
private List<Bookmark> _bookmarks = [];
2626
private readonly CancellationTokenSource _cancellationTokenSource = new();
2727
private PeriodicTimer? _firefoxBookmarkTimer;
2828
private static readonly TimeSpan FirefoxPollingInterval = TimeSpan.FromHours(3);
@@ -255,10 +255,10 @@ public string GetTranslatedPluginDescription()
255255
public List<Result> LoadContextMenus(Result selectedResult)
256256
{
257257
if (selectedResult.ContextData is not string url)
258-
return new List<Result>();
258+
return [];
259259

260-
return new List<Result>
261-
{
260+
return
261+
[
262262
new()
263263
{
264264
Title = Localize.flowlauncher_plugin_browserbookmark_copyurl_title(),
@@ -280,7 +280,7 @@ public List<Result> LoadContextMenus(Result selectedResult)
280280
}
281281
}
282282
}
283-
};
283+
];
284284
}
285285

286286
public void Dispose()

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public bool FetchMissingFavicons
8989
}
9090
}
9191

92-
private ObservableCollection<CustomBrowser> _customBrowsers = new();
92+
private ObservableCollection<CustomBrowser> _customBrowsers = [];
9393

9494
public ObservableCollection<CustomBrowser> CustomBrowsers
9595
{
@@ -98,7 +98,7 @@ public ObservableCollection<CustomBrowser> CustomBrowsers
9898
{
9999
if (_customBrowsers != value)
100100
{
101-
_customBrowsers = value ?? new();
101+
_customBrowsers = value ?? [];
102102
OnPropertyChanged();
103103
}
104104
}

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Services/BookmarkWatcherService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Threading;
55
namespace Flow.Launcher.Plugin.BrowserBookmark.Services;
66

77
public class BookmarkWatcherService : IDisposable
88
{
9-
private readonly List<FileSystemWatcher> _watchers = new();
9+
private readonly List<FileSystemWatcher> _watchers = [];
1010
public event Action OnBookmarkFileChanged;
1111

1212
// Timer to debounce file change events

0 commit comments

Comments
 (0)