unsafe fn go_up_once(&mut self, node: usize) -> Option<usize> {
        debug_assert!(self.nodes[node].as_ref().is_free());

        let (level, buddy) = {
            let entry = self.nodes[node].as_ref();
            let buddy = entry.get_buddy();

            if buddy >= self.nodes.len() || !self.nodes[buddy].as_ref().ready(entry) {
                return None;
            }

            (entry.level(), buddy)
        };

        debug_assert!(level + 1 < self.height);

        let major = min(node, buddy);
        let minor = max(node, buddy);

        let (left, right) = self.nodes.split_at_mut(minor);
        let major = &mut left[major];
        let minor = &mut right[0];

        self.lists[level].remove(major);
        self.lists[level].remove(minor);

        minor.as_mut().set_occupied();
        major.as_mut().set_level(level + 1);

        self.lists[level + 1].insert(major);

        Some(major.as_ref().num())
    }
/// Returns None if it can't be moved on the next level.
/// Otherwise returns a number of the main node in the pair on the next level.
Returns None if it can't be moved on the next level.
Otherwise returns a number of the main node in the pair on the next level.
Returns None if it can ' t be moved on the next level . Otherwise returns a number of the main node in the pair on the next level .
unsafe fn go_up_once(&mut self, node: usize) -> Option<usize> {
        debug_assert!(self.nodes[node].as_ref().is_free());
        let (level, buddy) = {
            let entry = self.nodes[node].as_ref();
            let buddy = entry.get_buddy();
            if buddy >= self.nodes.len() || !self.nodes[buddy].as_ref().ready(entry) {
                return None;
            }
            (entry.level(), buddy)
        };
        debug_assert!(level + 1 < self.height);
        let major = min(node, buddy);
        let minor = max(node, buddy);
        let (left, right) = self.nodes.split_at_mut(minor);
        let major = &mut left[major];
        let minor = &mut right[0];
        self.lists[level].remove(major);
        self.lists[level].remove(minor);
        minor.as_mut().set_occupied();
        major.as_mut().set_level(level + 1);
        self.lists[level + 1].insert(major);
        Some(major.as_ref().num())
    }
unsafe fn go_up_once ( & mut self , node : usize ) -> Option < usize > { debug_assert ! ( self nodes [ node ] as_ref ( ) is_free ( ) ) ; let ( level , buddy ) = { let entry = self . nodes [ node ] . as_ref ( ) ; let buddy = entry . get_buddy ( ) ; if buddy >= self . nodes . len ( ) || ! self . nodes [ buddy ] . as_ref ( ) . ready ( entry ) { return None ; } ( entry . level ( ) , buddy ) } ; debug_assert ! ( level 1 self height ) ; let major = min ( node , buddy ) ; let minor = max ( node , buddy ) ; let ( left , right ) = self . nodes . split_at_mut ( minor ) ; let major = & mut left [ major ] ; let minor = & mut right [ 0 ] ; self . lists [ level ] . remove ( major ) ; self . lists [ level ] . remove ( minor ) ; minor . as_mut ( ) . set_occupied ( ) ; major . as_mut ( ) . set_level ( level + 1 ) ; self . lists [ level + 1 ] . insert ( major ) ; Some ( major . as_ref ( ) . num ( ) ) }
Returns None if it can't be moved on the next level.
Returns None if it can ' t be moved on the next level .
&mut self
node
usize
&mut self
node
usize