fn next_direction_is_left(&mut self, key: &ADKey, r: &InternalNode) -> bool {
        let ret = if self.found {
            true
        } else {
            match (*key).cmp(r.hdr.key.as_ref().unwrap()) {
                Ordering::Equal => {
                    // found in the tree -- go one step right, then left to the leaf
                    self.found = true;
                    self.last_right_step = self.directions_bit_length;
                    false
                }
                Ordering::Less =>
                // going left
                {
                    true
                }
                Ordering::Greater =>
                // going right
                {
                    false
                }
            }
        };

        // encode Booleans as bits
        if (self.directions_bit_length & 7) == 0 {
            // new byte needed
            self.directions.push(if ret { 1u8 } else { 0u8 });
        } else {
            if ret {
                let i = self.directions_bit_length >> 3;
                self.directions[i] |= 1 << (self.directions_bit_length & 7);
                // change last byte
            }
        }
        self.directions_bit_length += 1;
        ret
    }
///
/// Figures out whether to go left or right when from node r when searching for the key,
/// using the appropriate bit in the directions bit string from the proof
///
/// @param key
/// @param r
/// @return - true if to go left, false if to go right in the search
///
Figures out whether to go left or right when from node r when searching for the key,
using the appropriate bit in the directions bit string from the proof
Figures out whether to go left or right when from node r when searching for the key using the appropriate bit in the directions bit string from the proof
fn next_direction_is_left(&mut self, key: &ADKey, r: &InternalNode) -> bool {
        let ret = if self.found {
            true
        } else {
            match (*key).cmp(r.hdr.key.as_ref().unwrap()) {
                Ordering::Equal => {
                    // found in the tree -- go one step right, then left to the leaf
                    self.found = true;
                    self.last_right_step = self.directions_bit_length;
                    false
                }
                Ordering::Less =>
                // going left
                {
                    true
                }
                Ordering::Greater =>
                // going right
                {
                    false
                }
            }
        };
        // encode Booleans as bits
        if (self.directions_bit_length & 7) == 0 {
            // new byte needed
            self.directions.push(if ret { 1u8 } else { 0u8 });
        } else {
            if ret {
                let i = self.directions_bit_length >> 3;
                self.directions[i] |= 1 << (self.directions_bit_length & 7);
                // change last byte
            }
        }
        self.directions_bit_length += 1;
        ret
    }
fn next_direction_is_left ( & mut self , key : & ADKey , r : & InternalNode ) -> bool { let ret = if self . found { true } else { match ( * key ) . cmp ( r . hdr . key . as_ref ( ) . unwrap ( ) ) { Ordering :: Equal => { // found in the tree -- go one step right, then left to the leaf self . found = true ; self . last_right_step = self . directions_bit_length ; false } Ordering :: Less => // going left { true } Ordering :: Greater => // going right { false } } } ; // encode Booleans as bits if ( self . directions_bit_length & 7 ) == 0 { // new byte needed self . directions . push ( if ret { 1u8 } else { 0u8 } ) ; } else { if ret { let i = self . directions_bit_length >> 3 ; self . directions [ i ] |= 1 << ( self . directions_bit_length & 7 ) ; // change last byte } } self . directions_bit_length += 1 ; ret }
Figures out whether to go left or right when from node r when searching for the key,
using the appropriate bit in the directions bit string from the proof
Figures out whether to go left or right when from node r when searching for the key using the appropriate bit in the directions bit string from the proof
&mut self
key
&ADKey
r
&InternalNode
true if to go left, false if to go right in the search
true if to go left false if to go right in the search
&mut self
key
&ADKey
None
r
&InternalNode
None