Skip to content

Commit

Permalink
Auto merge of #31038 - gereeter:btree-panic, r=Gankro
Browse files Browse the repository at this point in the history
…ving elements into it.

Fixes #31029.
  • Loading branch information
bors committed Jan 20, 2016
2 parents 7561466 + 707afa2 commit c4c9628
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcollections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,8 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
}
self.node.as_leaf_mut().len -= 1;

left_node.as_leaf_mut().len += right_len as u16 + 1;

if self.node.height > 1 {
ptr::copy_nonoverlapping(
right_node.cast_unchecked().as_internal().edges.as_ptr(),
Expand Down Expand Up @@ -1058,8 +1060,6 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
);
}

left_node.as_leaf_mut().len += right_len as u16 + 1;

Handle::new_edge(self.node, self.idx)
}
}
Expand Down

0 comments on commit c4c9628

Please sign in to comment.