Skip to content

Commit 0c8731e

Browse files
committed
Replaced list::each with iter() in Arenas's Drop impl
1 parent 52524bf commit 0c8731e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/libarena/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
extern crate collections;
2626

2727
use collections::list::{List, Cons, Nil};
28-
use collections::list;
2928

3029
use std::cast::{transmute, transmute_mut, transmute_mut_region};
3130
use std::cast;
@@ -44,7 +43,7 @@ use std::vec;
4443
// The way arena uses arrays is really deeply awful. The arrays are
4544
// allocated, and have capacities reserved, but the fill for the array
4645
// will always stay at 0.
47-
#[deriving(Clone)]
46+
#[deriving(Clone, Eq)]
4847
struct Chunk {
4948
data: Rc<RefCell<~[u8]>>,
5049
fill: Cell<uint>,
@@ -119,13 +118,11 @@ impl Drop for Arena {
119118
fn drop(&mut self) {
120119
unsafe {
121120
destroy_chunk(&self.head);
122-
123-
list::each(self.chunks.get(), |chunk| {
121+
for chunk in self.chunks.get().iter() {
124122
if !chunk.is_pod.get() {
125123
destroy_chunk(chunk);
126124
}
127-
true
128-
});
125+
}
129126
}
130127
}
131128
}

0 commit comments

Comments
 (0)