diff --git a/src/data/graph.rs b/src/data/graph.rs index c15d5c9..a9e9847 100644 --- a/src/data/graph.rs +++ b/src/data/graph.rs @@ -162,39 +162,13 @@ impl HierarchicalINodeGraph }); } } - fn create_from(graph: &INodeInfoGraph) -> Self - { - let mut new = Self { - table: HashMap::with_capacity(graph.inodes.len()), - }; - for (path, &inode) in graph.paths.iter() - { - //Lookup the INode in graph inode table - if let Some(fsinfo) = graph.inodes.get(&inode) - { - match fsinfo { - FsInfo::File(sz, parent) => { - new.table.insert(path.clone(), HierarchicalNode { - kind: NodeKind::File(*sz), - inode, - }); - }, - FsInfo::Directory(parent) => { - new.table.insert(path.clone(), HierarchicalNode { - kind: NodeKind::Directory(graph.children.get(&inode).unwrap().iter().map(|node| { - graph.paths_reverse.get(node).unwrap().clone() - }).collect(), None), - inode, - }); - }, - } - } - } - - new + #[inline(always)] fn create(graph: INodeInfoGraph) -> Self + { + //eh... + Self::create_from(&graph) } - fn create(graph: INodeInfoGraph) -> Self + fn create_from(graph: &INodeInfoGraph) -> Self { let mut new = Self { table: HashMap::with_capacity(graph.inodes.len()),