mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +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;
|
return s_filetype_image_icon;
|
||||||
|
|
||||||
for (auto& filetype : s_filetype_icons.keys()) {
|
for (auto& filetype : s_filetype_icons.keys()) {
|
||||||
auto patterns = s_filetype_patterns.get(filetype).value();
|
auto pattern_it = s_filetype_patterns.find(filetype);
|
||||||
for (auto& pattern : patterns) {
|
if (pattern_it == s_filetype_patterns.end())
|
||||||
|
continue;
|
||||||
|
for (auto& pattern : pattern_it->value) {
|
||||||
if (path.matches(pattern, CaseSensitivity::CaseInsensitive))
|
if (path.matches(pattern, CaseSensitivity::CaseInsensitive))
|
||||||
return s_filetype_icons.get(filetype).value();
|
return s_filetype_icons.get(filetype).value();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue