fix: avoid searching for icons that previously could not be found

Causes significant CPU usage in some areas
This commit is contained in:
Michael Aaron Murphy 2025-02-08 00:01:18 +01:00
parent 7a4d94f951
commit a28483f3d1
No known key found for this signature in database
GPG key ID: B2732D4240C9212C

View file

@ -288,8 +288,10 @@ impl<'a> LookupBuilder<'a> {
// If the icon was previously search but not found, we return
// `None` early, otherwise, attempt to perform a lookup
if self.cache {
if let CacheEntry::Found(icon) = self.cache_lookup(self.theme) {
return Some(icon);
match self.cache_lookup(self.theme) {
CacheEntry::Found(icon) => return Some(icon),
CacheEntry::NotFound => return None,
_ => ()
}
}