Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow up on BTreeMap comments #70979

Merged
merged 2 commits into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/liballoc/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2788,8 +2788,6 @@ impl<'a, K: 'a, V: 'a> Handle<NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInter
pos.next_unchecked();
}
}

// This internal node might be underfull, but only if it's the root.
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/collections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl<K, V> Root<K, V> {
NodeRef {
height: self.height,
node: self.node.as_ptr(),
root: self as *const _ as *mut _,
root: ptr::null(),
Copy link
Contributor Author

@ssomers ssomers Apr 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In accordance with the old comment on line 256 and reality (nobody needs that root).

_marker: PhantomData,
}
}
Expand All @@ -179,7 +179,7 @@ impl<K, V> Root<K, V> {
NodeRef {
height: self.height,
node: self.node.as_ptr(),
root: ptr::null_mut(), // FIXME: Is there anything better to do here?
root: ptr::null(),
Copy link
Contributor Author

@ssomers ssomers Apr 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt that comment was about the unnecessary _mut for a marker::Immut NodeRef, but I think the question has timed out for this particular place, and applies to everything in BTreeMap anyway.

_marker: PhantomData,
}
}
Expand Down