mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 04:27:12 +02:00
Ext2FS: Make Ext2FSInode::is_directory() fast
This patch overloads Inode::is_directory() with a faster version that doesn't require instantiating the whole InodeMetadata. If you have an Ext2FSInode&, calling is_directory() should be instant since we can just look directly at the raw inode bits.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 11:51:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5ab044beae2
@@ -19,6 +19,7 @@ public:
|
||||
|
||||
size_t size() const { return m_raw_inode.i_size; }
|
||||
bool is_symlink() const { return ::is_symlink(m_raw_inode.i_mode); }
|
||||
bool is_directory() const { return ::is_directory(m_raw_inode.i_mode); }
|
||||
|
||||
// ^Inode (RefCounted magic)
|
||||
virtual void one_ref_left() override;
|
||||
|
||||
Reference in New Issue
Block a user