Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 11525e5

Browse files
authored
fix document
https://users.rust-lang.org/t/is-the-document-in-sortedmap-in-rustc-data-structures-sorted-map-correct/84939 SortedMap have `O(n)` insertions and removal rather than `O(log(n))`
1 parent dd12cd6 commit 11525e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_data_structures/src/sorted_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ mod index_map;
1010
pub use index_map::SortedIndexMultiMap;
1111

1212
/// `SortedMap` is a data structure with similar characteristics as BTreeMap but
13-
/// slightly different trade-offs: lookup, insertion, and removal are *O*(log(*n*))
14-
/// and elements can be iterated in order cheaply.
13+
/// slightly different trade-offs: lookup is *O*(log(*n*)), insertion and removal
14+
/// are *O*(*n*) but elements can be iterated in order cheaply.
1515
///
1616
/// `SortedMap` can be faster than a `BTreeMap` for small sizes (<50) since it
1717
/// stores data in a more compact way. It also supports accessing contiguous

0 commit comments

Comments
 (0)