mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
Ext2FS: Remove unnecessary extra cache lookup in get_inode()
This commit is contained in:
parent
ba997c0a72
commit
5d08665d9a
Notes:
sideshowbarker
2024-07-19 11:10:42 +09:00
Author: https://github.com/awesomekling
Commit: 5d08665d9a
1 changed files with 0 additions and 5 deletions
|
@ -595,11 +595,6 @@ RefPtr<Inode> Ext2FS::get_inode(InodeIdentifier inode) const
|
|||
if (!read_block_containing_inode(inode.index(), block_index, offset, block))
|
||||
return {};
|
||||
|
||||
// FIXME: Do we really need to check the cache once again?
|
||||
// We've been holding m_lock this whole time.
|
||||
auto it = m_inode_cache.find(inode.index());
|
||||
if (it != m_inode_cache.end())
|
||||
return (*it).value;
|
||||
auto new_inode = adopt(*new Ext2FSInode(const_cast<Ext2FS&>(*this), inode.index()));
|
||||
memcpy(&new_inode->m_raw_inode, reinterpret_cast<ext2_inode*>(block + offset), sizeof(ext2_inode));
|
||||
m_inode_cache.set(inode.index(), new_inode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue