瀏覽代碼

Kernel: Always pass InodeIdentifier by value

These objects are small, there are no benefits to passing by reference.
Andreas Kling 3 年之前
父節點
當前提交
c427f8bbeb
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      Kernel/FileSystem/Inode.cpp
  2. 2 2
      Kernel/FileSystem/Inode.h

+ 2 - 2
Kernel/FileSystem/Inode.cpp

@@ -202,7 +202,7 @@ void Inode::set_metadata_dirty(bool metadata_dirty)
     }
 }
 
-void Inode::did_add_child(InodeIdentifier const&, String const& name)
+void Inode::did_add_child(InodeIdentifier, String const& name)
 {
     MutexLocker locker(m_inode_lock);
 
@@ -211,7 +211,7 @@ void Inode::did_add_child(InodeIdentifier const&, String const& name)
     }
 }
 
-void Inode::did_remove_child(InodeIdentifier const&, String const& name)
+void Inode::did_remove_child(InodeIdentifier, String const& name)
 {
     MutexLocker locker(m_inode_lock);
 

+ 2 - 2
Kernel/FileSystem/Inode.h

@@ -106,8 +106,8 @@ protected:
     void set_metadata_dirty(bool);
     ErrorOr<void> prepare_to_write_data();
 
-    void did_add_child(InodeIdentifier const& child_id, String const& name);
-    void did_remove_child(InodeIdentifier const& child_id, String const& name);
+    void did_add_child(InodeIdentifier child_id, String const& name);
+    void did_remove_child(InodeIdentifier child_id, String const& name);
     void did_modify_contents();
     void did_delete_self();