Merge pull request #222 from Flow-Launcher/allow_missing_default_img_dict_remove

Allow MissingImgIcon and DefaultIcon to be removed from image cache
This commit is contained in:
Jeremy Wu 2020-11-28 19:58:37 +11:00 committed by GitHub
commit 6617d03c32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,14 +65,8 @@ namespace Flow.Launcher.Infrastructure.Image
if (Data.Count > permissibleFactor * MaxCached)
{
// To delete the images from the data dictionary based on the resizing of the Usage Dictionary.
foreach (var key in Data.OrderBy(x => x.Value.usage).Take(Data.Count - MaxCached).Select(x => x.Key))
{
if (!(key.Equals(Constant.ErrorIcon) || key.Equals(Constant.DefaultIcon)))
{
Data.TryRemove(key, out _);
}
}
Data.TryRemove(key, out _);
}
}
}