rust/library
Nicholas Nethercote 679c5ee244 Optimize Vec::insert for the case where index == len.
By skipping the call to `copy` with a zero length. This makes it closer
to `push`.

I did this recently for `SmallVec`
(https://github.com/servo/rust-smallvec/pull/282) and it was a big perf win in
one case. Although I don't have a specific use case in mind, it seems
worth doing it for `Vec` as well.

Things to note:
- In the `index < len` case, the number of conditions checked is
  unchanged.
- In the `index == len` case, the number of conditions checked increases
  by one, but the more expensive zero-length copy is avoided.
- In the `index > len` case the code now reserves space for the extra
  element before panicking. This seems like an unimportant change.
2022-07-01 06:46:30 +10:00
..
alloc Optimize Vec::insert for the case where index == len. 2022-07-01 06:46:30 +10:00
backtrace@4e5a3f7292 update libbacktrace 2022-05-20 09:30:26 +02:00
core Rollup merge of #98516 - dlrobertson:uefi_va_list, r=joshtriplett 2022-06-29 17:59:34 +05:30
panic_abort Fully stabilize NLL 2022-06-03 17:16:41 -04:00
panic_unwind Add underscores to rust_eh_personality arguments to mark them as unused 2022-06-09 09:50:26 -07:00
portable-simd Finish bumping stage0 2022-05-27 07:36:17 -04:00
proc_macro review changes 2022-06-28 09:54:29 -04:00
profiler_builtins Fully stabilize NLL 2022-06-03 17:16:41 -04:00
rtstartup
rustc-std-workspace-alloc Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rustc-std-workspace-core Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rustc-std-workspace-std Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
std Rollup merge of #98617 - ChrisDenton:const-unwrap, r=Mark-Simulacrum 2022-06-28 18:34:33 +02:00
stdarch@28335054b1 Also allow unused macro rules in stdarch 2022-05-10 19:53:22 +02:00
test Fully stabilize NLL 2022-06-03 17:16:41 -04:00
unwind Stabilize the bundle native library modifier 2022-06-09 23:12:58 +04:00