mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
LibGUI: Avoid unnecessary copies in FileIconProvider
This commit is contained in:
parent
b7c0c32f24
commit
13acf603d8
1 changed files with 4 additions and 2 deletions
|
@ -267,8 +267,10 @@ Icon FileIconProvider::icon_for_path(const String& path, mode_t mode)
|
|||
return s_filetype_image_icon;
|
||||
|
||||
for (auto& filetype : s_filetype_icons.keys()) {
|
||||
auto patterns = s_filetype_patterns.get(filetype).value();
|
||||
for (auto& pattern : patterns) {
|
||||
auto pattern_it = s_filetype_patterns.find(filetype);
|
||||
if (pattern_it == s_filetype_patterns.end())
|
||||
continue;
|
||||
for (auto& pattern : pattern_it->value) {
|
||||
if (path.matches(pattern, CaseSensitivity::CaseInsensitive))
|
||||
return s_filetype_icons.get(filetype).value();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue