about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-05 06:40:29 +0100
committerGitHub <noreply@github.com>2024-03-05 06:40:29 +0100
commit22827fd5b1ca5f4a588dab2ae50c3b7a138d89b0 (patch)
tree554fe466f63f6a535700f907bcbf3024931eb612 /compiler/rustc_pattern_analysis/src
parentc2f6c0b8062c3903e1ade11179f5a0c4256d2e00 (diff)
parent74151cbbf04477b646c7fcfd1db60f9c79c06081 (diff)
downloadrust-22827fd5b1ca5f4a588dab2ae50c3b7a138d89b0.tar.gz
rust-22827fd5b1ca5f4a588dab2ae50c3b7a138d89b0.zip
Rollup merge of #121262 - 20jasper:add-vector-time-complexity, r=cuviper
Add vector time complexity

Added time complexity for `Vec` methods `push`, `push_within_capacity`, `pop`, and `insert`.

<details>

<summary> Reference images </summary>

![`Vec::push` documentation](https://github.com/rust-lang/rust/assets/78604367/dc966bbd-e92e-45a6-af82-35afabfa79a9)

![`Vec::push_within_capacity` documentation](https://github.com/rust-lang/rust/assets/78604367/9aadaf48-46ed-4fad-bdd5-74b98a61f4bb)

![`Vec::pop` documentation](https://github.com/rust-lang/rust/assets/78604367/88ec0389-a346-4ea5-a3b7-17caf514dd8b)

![`Vec::insert` documentation](https://github.com/rust-lang/rust/assets/78604367/960c15c3-ef8e-4aa7-badc-35ce80f6f221)

</details>

I followed a convention to use `#Time complexity` that I found in [the `BinaryHeap` documentation](https://doc.rust-lang.org/std/collections/struct.BinaryHeap.html#time-complexity-1). Looking through the rest of standard library collections, there is not a consistent way to handle this.

[`Vec::swap_remove`](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.swap_remove) does not have a dedicated section for time complexity but does list it.

[`VecDeque::rotate_left`](https://doc.rust-lang.org/std/collections/struct.VecDeque.html#complexity) uses a `#complexity` heading.
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
0 files changed, 0 insertions, 0 deletions