Skip to content

Commit

Permalink
Replaced list::each with iter() in Arenas's Drop impl
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoabinader committed Feb 27, 2014
1 parent 52524bf commit 0c8731e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/libarena/lib.rs
Expand Up @@ -25,7 +25,6 @@
extern crate collections;

use collections::list::{List, Cons, Nil};
use collections::list;

use std::cast::{transmute, transmute_mut, transmute_mut_region};
use std::cast;
Expand All @@ -44,7 +43,7 @@ use std::vec;
// The way arena uses arrays is really deeply awful. The arrays are
// allocated, and have capacities reserved, but the fill for the array
// will always stay at 0.
#[deriving(Clone)]
#[deriving(Clone, Eq)]
struct Chunk {
data: Rc<RefCell<~[u8]>>,
fill: Cell<uint>,
Expand Down Expand Up @@ -119,13 +118,11 @@ impl Drop for Arena {
fn drop(&mut self) {
unsafe {
destroy_chunk(&self.head);

list::each(self.chunks.get(), |chunk| {
for chunk in self.chunks.get().iter() {
if !chunk.is_pod.get() {
destroy_chunk(chunk);
}
true
});
}
}
}
}
Expand Down

0 comments on commit 0c8731e

Please sign in to comment.