@@ -19,16 +19,16 @@ mod entry;
1919pub use entry:: { Entry , OccupiedEntry , OccupiedError , VacantEntry } ;
2020use Entry :: * ;
2121
22- /// Minimum number of elements in nodes that are not a root.
22+ /// Minimum number of elements in a node that is not a root.
2323/// We might temporarily have fewer elements during methods.
2424pub ( super ) const MIN_LEN : usize = node:: MIN_LEN_AFTER_SPLIT ;
2525
2626// A tree in a `BTreeMap` is a tree in the `node` module with additional invariants:
2727// - Keys must appear in ascending order (according to the key's type).
28- // - If the root node is internal, it must contain at least 1 element .
28+ // - Every non-leaf node contains at least 1 element (has at least 2 children) .
2929// - Every non-root node contains at least MIN_LEN elements.
3030//
31- // An empty map may be represented both by the absence of a root node or by a
31+ // An empty map is represented either by the absence of a root node or by a
3232// root node that is an empty leaf.
3333
3434/// A map based on a [B-Tree].
@@ -1735,8 +1735,8 @@ impl<'a, K: 'a, V: 'a> DrainFilterInner<'a, K, V> {
17351735 pub ( super ) fn size_hint ( & self ) -> ( usize , Option < usize > ) {
17361736 // In most of the btree iterators, `self.length` is the number of elements
17371737 // yet to be visited. Here, it includes elements that were visited and that
1738- // the predicate decided not to drain. Making this upper bound more accurate
1739- // requires maintaining an extra field and is not worth while .
1738+ // the predicate decided not to drain. Making this upper bound more tight
1739+ // during iteration would require an extra field.
17401740 ( 0 , Some ( * self . length ) )
17411741 }
17421742}
0 commit comments