Rollup merge of #40790 - stepancheg:btreemap-drop, r=alexcrichton
Unnecessary iteration in BTreeMap::drop `IntoIter::drop` already iterates.
This commit is contained in:
commit
eb6f09ce24
@ -141,8 +141,7 @@ pub struct BTreeMap<K, V> {
|
|||||||
unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for BTreeMap<K, V> {
|
unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for BTreeMap<K, V> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
for _ in ptr::read(self).into_iter() {
|
drop(ptr::read(self).into_iter());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user