mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibGUI: Avoid unnecessary copies in FileIconProvider
This commit is contained in:
parent
b7c0c32f24
commit
13acf603d8
Notes:
sideshowbarker
2024-07-17 21:50:17 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/13acf603d8c Pull-request: https://github.com/SerenityOS/serenity/pull/11408
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…
Reference in a new issue