fn find_node(&mut self, hash: Hash32) -> FindNodeResult {

        // use the first 24-bit as index in the root hash table
        let mut ptr = &self.hash_index_root[hash_to_index(hash)];

        // from there, we follow the binary tree
        while !ptr.is_null() {
            let node: &Node = self.fileset.read_fixed(*ptr);

            ptr = match hash.0.cmp(&node.hash.as_ref().0) {
                Ordering::Less    => &node.prev,
                Ordering::Greater => &node.next,
                Ordering::Equal   => return FindNodeResult::Found(node)
            };
        }

        FindNodeResult::NotFound(ptr)
    }
// Finds the node containing the hash, or the location the hash should be inserted
Finds the node containing the hash, or the location the hash should be inserted
Finds the node containing the hash or the location the hash should be inserted
fn find_node(&mut self, hash: Hash32) -> FindNodeResult {
        // use the first 24-bit as index in the root hash table
        let mut ptr = &self.hash_index_root[hash_to_index(hash)];
        // from there, we follow the binary tree
        while !ptr.is_null() {
            let node: &Node = self.fileset.read_fixed(*ptr);
            ptr = match hash.0.cmp(&node.hash.as_ref().0) {
                Ordering::Less    => &node.prev,
                Ordering::Greater => &node.next,
                Ordering::Equal   => return FindNodeResult::Found(node)
            };
        }
        FindNodeResult::NotFound(ptr)
    }
fn find_node ( & mut self , hash : Hash32 ) -> FindNodeResult { // use the first 24-bit as index in the root hash table let mut ptr = & self . hash_index_root [ hash_to_index ( hash ) ] ; // from there, we follow the binary tree while ! ptr . is_null ( ) { let node : & Node = self . fileset . read_fixed ( * ptr ) ; ptr = match hash . 0 . cmp ( & node . hash . as_ref ( ) . 0 ) { Ordering :: Less => & node . prev , Ordering :: Greater => & node . next , Ordering :: Equal => return FindNodeResult :: Found ( node ) } ; } FindNodeResult :: NotFound ( ptr ) }
Finds the node containing the hash, or the location the hash should be inserted
Finds the node containing the hash or the location the hash should be inserted
&mut self
hash
Hash32
&mut self
hash
Hash32