mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 08:18:49 +00:00
Ext2FS: Avoid a String allocation in lookup()
By using find() with a custom finder, we can avoid creating a temporary key value that's only used for the hash lookup.
This commit is contained in:
parent
d38bd3935b
commit
ac7a559d96
Notes:
sideshowbarker
2024-07-19 12:32:55 +09:00
Author: https://github.com/awesomekling
Commit: ac7a559d96
1 changed files with 1 additions and 1 deletions
|
@ -1263,7 +1263,7 @@ InodeIdentifier Ext2FSInode::lookup(StringView name)
|
|||
ASSERT(is_directory());
|
||||
populate_lookup_cache();
|
||||
LOCKER(m_lock);
|
||||
auto it = m_lookup_cache.find(name);
|
||||
auto it = m_lookup_cache.find(name.hash(), [&](auto& entry) { return entry.key == name; });
|
||||
if (it != m_lookup_cache.end())
|
||||
return { fsid(), (*it).value };
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue