@@ -55,12 +55,12 @@ impl<'a, K: 'a, V: 'a> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, mark
5555 pos = unsafe { new_pos. cast_to_leaf_unchecked ( ) } ;
5656
5757 // Only if we merged, the parent (if any) has shrunk, but skipping
58- // the following step does not pay off in benchmarks.
58+ // the following step otherwise does not pay off in benchmarks.
5959 //
6060 // SAFETY: We won't destroy or rearrange the leaf where `pos` is at
6161 // by handling its parent recursively; at worst we will destroy or
6262 // rearrange the parent through the grandparent, thus change the
63- // leaf's parent pointer .
63+ // link to the parent inside the leaf .
6464 if let Ok ( parent) = unsafe { pos. reborrow_mut ( ) } . into_node ( ) . ascend ( ) {
6565 parent. into_node ( ) . handle_shrunk_node_recursively ( handle_emptied_internal_root) ;
6666 }
@@ -92,8 +92,8 @@ impl<'a, K: 'a, V: 'a> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>,
9292}
9393
9494impl < ' a , K : ' a , V : ' a > NodeRef < marker:: Mut < ' a > , K , V , marker:: Internal > {
95- /// Stocks up a possibly underfull internal node, recursively.
96- /// Climbs up until it reaches an ancestor that has elements to spare or the root.
95+ /// Stocks up a possibly underfull internal node and its ancestors,
96+ /// until it reaches an ancestor that has elements to spare or is the root.
9797 fn handle_shrunk_node_recursively < F : FnOnce ( ) > ( mut self , handle_emptied_internal_root : F ) {
9898 loop {
9999 self = match self . len ( ) {
@@ -124,7 +124,7 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::Internal> {
124124 ) -> Option < NodeRef < marker:: Mut < ' a > , K , V , marker:: Internal > > {
125125 match self . forget_type ( ) . choose_parent_kv ( ) {
126126 Ok ( Left ( left_parent_kv) ) => {
127- debug_assert ! ( left_parent_kv. right_child_len( ) == MIN_LEN - 1 ) ;
127+ debug_assert_eq ! ( left_parent_kv. right_child_len( ) , MIN_LEN - 1 ) ;
128128 if left_parent_kv. can_merge ( ) {
129129 let pos = left_parent_kv. merge ( None ) ;
130130 let parent_edge = unsafe { unwrap_unchecked ( pos. into_node ( ) . ascend ( ) . ok ( ) ) } ;
@@ -136,7 +136,7 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::Internal> {
136136 }
137137 }
138138 Ok ( Right ( right_parent_kv) ) => {
139- debug_assert ! ( right_parent_kv. left_child_len( ) == MIN_LEN - 1 ) ;
139+ debug_assert_eq ! ( right_parent_kv. left_child_len( ) , MIN_LEN - 1 ) ;
140140 if right_parent_kv. can_merge ( ) {
141141 let pos = right_parent_kv. merge ( None ) ;
142142 let parent_edge = unsafe { unwrap_unchecked ( pos. into_node ( ) . ascend ( ) . ok ( ) ) } ;
0 commit comments