Improve a few vectors - calculate capacity or build from iterators#52703
Improve a few vectors - calculate capacity or build from iterators#52703bors merged 1 commit intorust-lang:masterfrom
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc/traits/object_safety.rs
Outdated
There was a problem hiding this comment.
Fair point; I'd still consider it, though, since it improves readability and is almost a half shorter.
There was a problem hiding this comment.
It looks like this will hold the bytes of UTF-16; should it then be 2*args.len?
There was a problem hiding this comment.
Actually it should be (1 + args.len()) * 2, as each step of the for loop pushes 2 u8s. Thanks, I missed that.
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
Spurious error. |
|
@kennytm can you trigger a retest pls? |
|
@ljedrz you could always re-trigger by reopening the PR. |
|
@kennytm didn't know that, thanks! |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
@bors r+ |
|
📌 Commit acd38f6 has been approved by |
…akis Improve a few vectors - calculate capacity or build from iterators Collecting from iterators improves readability and tailoring vector capacities should be beneficial in terms of performance.
Rollup of 11 pull requests Successful merges: - #52702 (Suggest fix when encountering different mutability from impl to trait) - #52703 (Improve a few vectors - calculate capacity or build from iterators) - #52740 (Suggest underscore when using dashes in crate namet push fork) - #52759 (Impl Send & Sync for JoinHandle) - #52760 (rustc_metadata: test loading atoi instead of cos) - #52763 (Omit the vendor component in Fuchsia triple) - #52765 (Remove unused "-Zenable_nonzeroing_move_hints" flag) - #52769 (Incorporate a stray test) - #52777 (Fix doc comment for 'ptr::copy_to' method) - #52779 (revert accidental atty downgrade) - #52781 (Use a slice where a vector is not necessary) Failed merges: r? @ghost
Collecting from iterators improves readability and tailoring vector capacities should be beneficial in terms of performance.