We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c262c98 commit b576db6Copy full SHA for b576db6
src/libcollections/btree/map.rs
@@ -541,13 +541,15 @@ mod stack {
541
// Walk into the smallest subtree of this node
542
let node = temp_node;
543
let node_ptr = node as *mut _;
544
- self.stack.push((node_ptr, 0));
+
545
if node.is_leaf() {
546
// This node is a leaf, do the swap and return
547
+ self.top = (node_ptr, 0);
548
node.unsafe_swap(0, &mut *key_ptr, &mut *val_ptr);
549
break;
550
} else {
551
// This node is internal, go deeper
552
+ self.stack.push((node_ptr, 0));
553
temp_node = node.unsafe_edge_mut(0);
554
}
555
0 commit comments