Unnecessary iteration in BTreeMap::drop

`IntoIter::drop` already iterates.
This commit is contained in:
Stepan Koltsov 2017-03-24 06:18:23 +03:00
parent e703b33e3e
commit f97b3f08cd

View File

@ -141,8 +141,7 @@ pub struct BTreeMap<K, V> {
unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for BTreeMap<K, V> {
fn drop(&mut self) {
unsafe {
for _ in ptr::read(self).into_iter() {
}
drop(ptr::read(self).into_iter());
}
}
}