Add a Table::zero method to clear all entries

master
Philipp Oppermann 8 years ago
parent 2b7fa410fb
commit e50d70c02e

@ -6,6 +6,14 @@ pub struct Table {
entries: [Entry; ENTRY_COUNT], entries: [Entry; ENTRY_COUNT],
} }
impl Table {
pub fn zero(&mut self) {
for entry in self.entries.iter_mut() {
entry.set_unused();
}
}
}
impl Index<usize> for Table { impl Index<usize> for Table {
type Output = Entry; type Output = Entry;

Loading…
Cancel
Save