Skip to content

Commit 35a2096

Browse files
committed
Fix comments based on review
1 parent 922ccac commit 35a2096

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

library/alloc/src/collections/btree/search.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,8 @@ impl<BorrowType: marker::BorrowType, K, V> NodeRef<BorrowType, K, V, marker::Lea
9494
K: Borrow<Q>,
9595
R: RangeBounds<Q>,
9696
{
97-
// It might be unsound to inline these variables if this logic changes (#81138).
98-
// We assume the bounds reported by `range` remain the same, but
99-
// an adversarial implementation could change between calls
97+
// Inlining these variables should be avoided. We assume the bounds reported by `range`
98+
// remain the same, but an adversarial implementation could change between calls (#81138).
10099
let (start, end) = (range.start_bound(), range.end_bound());
101100
match (start, end) {
102101
(Bound::Excluded(s), Bound::Excluded(e)) if s == e => {
@@ -114,8 +113,6 @@ impl<BorrowType: marker::BorrowType, K, V> NodeRef<BorrowType, K, V, marker::Lea
114113
loop {
115114
let (lower_edge_idx, lower_child_bound) = self.find_lower_bound_index(lower_bound);
116115
let (upper_edge_idx, upper_child_bound) = self.find_upper_bound_index(upper_bound);
117-
// SAFETY: This panic is used for safety, so external impls can't be called here. The
118-
// comparison is done with integers for that reason.
119116
if lower_edge_idx > upper_edge_idx {
120117
panic!("Ord is ill-defined in BTreeMap range")
121118
}

0 commit comments

Comments
 (0)