Skip to content

Commit defaa1d

Browse files
authored
Remove subheadings under Performance
1 parent c459f51 commit defaa1d

File tree

1 file changed

+6
-11
lines changed
  • library/std/src/collections

1 file changed

+6
-11
lines changed

library/std/src/collections/mod.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
//! see each type's documentation, and note that the names of actual methods may
8080
//! differ from the tables below on certain collections.
8181
//!
82-
//! ## Conventions
8382
//! Throughout the documentation, we will adhere to the following conventions for
8483
//! operation notation:
8584
//!
@@ -89,23 +88,19 @@
8988
//! * Operations which have an *amortized* cost are suffixed with a `*`.
9089
//! * Operations with an *expected* cost are suffixed with a `~`.
9190
//!
92-
//! ### Amortized Costs
93-
//!
9491
//! Calling operations that add to a collection will occasionally require a
9592
//! collection to be resized - an extra operation that takes *O*(*n*) time.
9693
//!
97-
//! Amortized costs are calculated to account for the time cost of this resize
98-
//! *over a sufficiently large series of operations*. An individual operation
99-
//! may be slower or faster due to the sporadic nature of collection resizing,
100-
//! however the average cost per operation will eventually equal the amortized
101-
//! cost.
94+
//! *Amortized* costs are calculated to account for the time cost of such resize
95+
//! operations *over a sufficiently large series of operations*. An individual
96+
//! operation may be slower or faster due to the sporadic nature of collection
97+
//! resizing, however the average cost per operation will eventually equal the
98+
//! amortized cost.
10299
//!
103100
//! Rust's collections never automatically shrink, so removal operations aren't
104101
//! amortized.
105102
//!
106-
//! ### Expected Costs
107-
//!
108-
//! [`HashMap`] uses expected costs to denote that it is theoretically possible,
103+
//! [`HashMap`] uses *expected costs to denote that it is theoretically possible,
109104
//! though very unlikely, for [`HashMap`] to experience worse performance than
110105
//! the expected cost. This is due to the probablilistic nature of hashing -
111106
//! i.e. it is possible to generate a duplicate hash given some input key that

0 commit comments

Comments
 (0)