Skip to content

Commit d8c547f

Browse files
committed
Improve code quality
1 parent 9dbc174 commit d8c547f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Flow.Launcher/Helper/WallpaperPathRetrieval.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ namespace Flow.Launcher.Helper;
1515
public static class WallpaperPathRetrieval
1616
{
1717
private static readonly int MAX_PATH = 260;
18+
private static readonly int MAX_CACHE_SIZE = 3;
1819

1920
private static readonly Dictionary<(string, DateTime), ImageBrush> wallpaperCache = new();
20-
private const int MaxCacheSize = 3;
2121

2222
public static Brush GetWallpaperBrush()
2323
{
@@ -54,7 +54,7 @@ public static Brush GetWallpaperBrush()
5454
wallpaperBrush.Freeze(); // Make the brush thread-safe
5555

5656
// Manage cache size
57-
if (wallpaperCache.Count >= MaxCacheSize)
57+
if (wallpaperCache.Count >= MAX_CACHE_SIZE)
5858
{
5959
// Remove the oldest wallpaper from the cache
6060
var oldestCache = wallpaperCache.Keys.OrderBy(k => k.Item2).FirstOrDefault();

0 commit comments

Comments
 (0)