mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve code quality
This commit is contained in:
parent
9dbc174994
commit
d8c547f7ef
1 changed files with 2 additions and 2 deletions
|
|
@ -15,9 +15,9 @@ namespace Flow.Launcher.Helper;
|
|||
public static class WallpaperPathRetrieval
|
||||
{
|
||||
private static readonly int MAX_PATH = 260;
|
||||
private static readonly int MAX_CACHE_SIZE = 3;
|
||||
|
||||
private static readonly Dictionary<(string, DateTime), ImageBrush> wallpaperCache = new();
|
||||
private const int MaxCacheSize = 3;
|
||||
|
||||
public static Brush GetWallpaperBrush()
|
||||
{
|
||||
|
|
@ -54,7 +54,7 @@ public static class WallpaperPathRetrieval
|
|||
wallpaperBrush.Freeze(); // Make the brush thread-safe
|
||||
|
||||
// Manage cache size
|
||||
if (wallpaperCache.Count >= MaxCacheSize)
|
||||
if (wallpaperCache.Count >= MAX_CACHE_SIZE)
|
||||
{
|
||||
// Remove the oldest wallpaper from the cache
|
||||
var oldestCache = wallpaperCache.Keys.OrderBy(k => k.Item2).FirstOrDefault();
|
||||
|
|
|
|||
Loading…
Reference in a new issue