@@ -54,12 +54,12 @@ impl<'a, K: 'a, V: 'a> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, mark
5454 pos = unsafe { new_pos. cast_to_leaf_unchecked ( ) } ;
5555
5656 // Only if we merged, the parent (if any) has shrunk, but skipping
57- // the following step does not pay off in benchmarks.
57+ // the following step otherwise does not pay off in benchmarks.
5858 //
5959 // SAFETY: We won't destroy or rearrange the leaf where `pos` is at
6060 // by handling its parent recursively; at worst we will destroy or
6161 // rearrange the parent through the grandparent, thus change the
62- // leaf's parent pointer .
62+ // link to the parent inside the leaf .
6363 if let Ok ( parent) = unsafe { pos. reborrow_mut ( ) } . into_node ( ) . ascend ( ) {
6464 parent. into_node ( ) . handle_shrunk_node_recursively ( handle_emptied_internal_root) ;
6565 }
@@ -90,8 +90,8 @@ impl<'a, K: 'a, V: 'a> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>,
9090}
9191
9292impl < ' a , K : ' a , V : ' a > NodeRef < marker:: Mut < ' a > , K , V , marker:: Internal > {
93- /// Stocks up a possibly underfull internal node, recursively.
94- /// Climbs up until it reaches an ancestor that has elements to spare or the root.
93+ /// Stocks up a possibly underfull internal node and its ancestors,
94+ /// until it reaches an ancestor that has elements to spare or is the root.
9595 fn handle_shrunk_node_recursively < F : FnOnce ( ) > ( mut self , handle_emptied_internal_root : F ) {
9696 loop {
9797 self = match self . len ( ) {
@@ -122,7 +122,7 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::Internal> {
122122 ) -> Option < NodeRef < marker:: Mut < ' a > , K , V , marker:: Internal > > {
123123 match self . forget_type ( ) . choose_parent_kv ( ) {
124124 Ok ( Left ( left_parent_kv) ) => {
125- debug_assert ! ( left_parent_kv. right_child_len( ) == MIN_LEN - 1 ) ;
125+ debug_assert_eq ! ( left_parent_kv. right_child_len( ) , MIN_LEN - 1 ) ;
126126 if left_parent_kv. can_merge ( ) {
127127 let pos = left_parent_kv. merge ( None ) ;
128128 let parent_edge = unsafe { unwrap_unchecked ( pos. into_node ( ) . ascend ( ) . ok ( ) ) } ;
@@ -134,7 +134,7 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::Internal> {
134134 }
135135 }
136136 Ok ( Right ( right_parent_kv) ) => {
137- debug_assert ! ( right_parent_kv. left_child_len( ) == MIN_LEN - 1 ) ;
137+ debug_assert_eq ! ( right_parent_kv. left_child_len( ) , MIN_LEN - 1 ) ;
138138 if right_parent_kv. can_merge ( ) {
139139 let pos = right_parent_kv. merge ( None ) ;
140140 let parent_edge = unsafe { unwrap_unchecked ( pos. into_node ( ) . ascend ( ) . ok ( ) ) } ;
0 commit comments