diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2025-01-11 15:14:31 +0100 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2025-01-15 22:50:25 +0100 |
| commit | ded9354dcf76aaa2cd2164a8b556f61c2f188d79 (patch) | |
| tree | 0d3884da3794a7189710486b141996fc18118661 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | ab55d3fc62c091fbc4b4273347aa8532976741e3 (diff) | |
| download | rust-ded9354dcf76aaa2cd2164a8b556f61c2f188d79.tar.gz rust-ded9354dcf76aaa2cd2164a8b556f61c2f188d79.zip | |
Suggest using `Vec::extend()` in `same_item_push`
Using `Vec::extend(std::iter::repeat_n(item, N))` allows to use the more natural number of elements to add `N`, as is probably done in the original loop, instead of computing the difference between the existing number of elements and the wanted one. Before MSRV 1.82, the older suggestion to use `Vec::resize()` is still issued.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
