pub fn split_off<Q: ?Sized + Ord>(&mut self, key: &Q) -> Self
    where
        K: Borrow<Q>,
    {
        if self.is_empty() {
            return Self::new();
        }
        let tol_cnt = self.len();
        let mut other_map = Self::new();
        let split_node = self.lower_bound_find_node(key);
        let self_head = unsafe { avl_node::avl_tree_convert_to_list(&mut self.root) };
        let (other_head, other_cnt) = unsafe {
            let mut cnt = 0;
            let mut node = split_node;
            let mut prev = ptr::null_mut();
            let mut head = ptr::null_mut();
            while node.not_null() {
                let entry = node.avl_node_deref_to_entry::<K, V>();
                let other_entry = other_map.entry_fastbin.alloc() as *mut AVLEntry<K, V>;
                ptr::copy_nonoverlapping(entry, other_entry, 1);
                self.entry_fastbin.del(entry as VoidPtr);
                let other_avl_node = other_entry.node_ptr();
                other_avl_node.set_left(prev);
                other_avl_node.set_right(ptr::null_mut());
                cnt += 1;
                if prev.not_null() {
                    prev.set_right(other_avl_node);
                } else {
                    head = other_avl_node;
                }
                prev = other_avl_node;
                node = node.right();
            }
            (head, cnt)
        };
        other_map.inner_init_from_sorted_list(other_head, other_cnt);
        self.inner_init_from_sorted_list(self_head, tol_cnt - other_cnt);
        other_map
    }
/// Splits the collection into two at the given key. Returns everything after the given key,
/// including the key.
///
/// # Examples
///
/// Basic usage:
///
/// ```
/// use hash_ord::ord_map::OrdMap;
///
/// let mut a = OrdMap::new();
/// a.insert(1, "a");
/// a.insert(2, "b");
/// a.insert(3, "c");
/// a.insert(17, "d");
/// a.insert(41, "e");
///
/// let b = a.split_off(&3);
///
/// assert_eq!(a.len(), 2);
/// assert_eq!(b.len(), 3);
///
/// assert_eq!(a[&1], "a");
/// assert_eq!(a[&2], "b");
///
/// assert_eq!(b[&3], "c");
/// assert_eq!(b[&17], "d");
/// assert_eq!(b[&41], "e");
/// ```
Splits the collection into two at the given key. Returns everything after the given key,
including the key.
Splits the collection into two at the given key . Returns everything after the given key including the key .
pub fn split_off<Q: ?Sized + Ord>(&mut self, key: &Q) -> Self
    where
        K: Borrow<Q>,
    {
        if self.is_empty() {
            return Self::new();
        }
        let tol_cnt = self.len();
        let mut other_map = Self::new();
        let split_node = self.lower_bound_find_node(key);
        let self_head = unsafe { avl_node::avl_tree_convert_to_list(&mut self.root) };
        let (other_head, other_cnt) = unsafe {
            let mut cnt = 0;
            let mut node = split_node;
            let mut prev = ptr::null_mut();
            let mut head = ptr::null_mut();
            while node.not_null() {
                let entry = node.avl_node_deref_to_entry::<K, V>();
                let other_entry = other_map.entry_fastbin.alloc() as *mut AVLEntry<K, V>;
                ptr::copy_nonoverlapping(entry, other_entry, 1);
                self.entry_fastbin.del(entry as VoidPtr);
                let other_avl_node = other_entry.node_ptr();
                other_avl_node.set_left(prev);
                other_avl_node.set_right(ptr::null_mut());
                cnt += 1;
                if prev.not_null() {
                    prev.set_right(other_avl_node);
                } else {
                    head = other_avl_node;
                }
                prev = other_avl_node;
                node = node.right();
            }
            (head, cnt)
        };
        other_map.inner_init_from_sorted_list(other_head, other_cnt);
        self.inner_init_from_sorted_list(self_head, tol_cnt - other_cnt);
        other_map
    }
pub fn split_off < Q : ? Sized + Ord > ( & mut self , key : & Q ) -> Self where K : Borrow < Q > , { if self . is_empty ( ) { return Self :: new ( ) ; } let tol_cnt = self . len ( ) ; let mut other_map = Self :: new ( ) ; let split_node = self . lower_bound_find_node ( key ) ; let self_head = unsafe { avl_node :: avl_tree_convert_to_list ( & mut self . root ) } ; let ( other_head , other_cnt ) = unsafe { let mut cnt = 0 ; let mut node = split_node ; let mut prev = ptr :: null_mut ( ) ; let mut head = ptr :: null_mut ( ) ; while node . not_null ( ) { let entry = node . avl_node_deref_to_entry :: < K , V > ( ) ; let other_entry = other_map . entry_fastbin . alloc ( ) as * mut AVLEntry < K , V > ; ptr :: copy_nonoverlapping ( entry , other_entry , 1 ) ; self . entry_fastbin . del ( entry as VoidPtr ) ; let other_avl_node = other_entry . node_ptr ( ) ; other_avl_node . set_left ( prev ) ; other_avl_node . set_right ( ptr :: null_mut ( ) ) ; cnt += 1 ; if prev . not_null ( ) { prev . set_right ( other_avl_node ) ; } else { head = other_avl_node ; } prev = other_avl_node ; node = node . right ( ) ; } ( head , cnt ) } ; other_map . inner_init_from_sorted_list ( other_head , other_cnt ) ; self . inner_init_from_sorted_list ( self_head , tol_cnt - other_cnt ) ; other_map }
Splits the collection into two at the given key.
Splits the collection into two at the given key .
&mut self
key
&Q
examples
Basic usage.

```
use hash_ord::ord_map::OrdMap.










Basic usage . ` ` ` use hash_ord :: ord_map :: OrdMap .