Skip to content

Commit

Permalink
Unnecessary iteration in BTreeMap::drop
Browse files Browse the repository at this point in the history
`IntoIter::drop` already iterates.
  • Loading branch information
stepancheg committed Mar 24, 2017
1 parent e703b33 commit f97b3f0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
Expand Down

0 comments on commit f97b3f0

Please sign in to comment.