Skip to content

Commit

Permalink
Auto merge of #84209 - pickfire:patch-3, r=jyn514
Browse files Browse the repository at this point in the history
Merge same condition branch in vec spec_extend

Follow up of #83726 (comment)
  • Loading branch information
bors committed Apr 15, 2021
2 parents f1ca558 + eeac70c commit 2962e7c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions library/alloc/src/vec/spec_extend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ where
default fn spec_extend(&mut self, iterator: I) {
// This is the case for a TrustedLen iterator.
let (low, high) = iterator.size_hint();
if let Some(high_value) = high {
if let Some(additional) = high {
debug_assert_eq!(
low,
high_value,
additional,
"TrustedLen iterator's size hint is not exact: {:?}",
(low, high)
);
}
if let Some(additional) = high {
self.reserve(additional);
unsafe {
let mut ptr = self.as_mut_ptr().add(self.len());
Expand Down

0 comments on commit 2962e7c

Please sign in to comment.