improve memory initialization

This commit is contained in:
mos 2024-04-19 11:07:42 +02:00
parent 4731e932cc
commit 5e961163c4
1 changed files with 3 additions and 3 deletions

View File

@ -94,9 +94,9 @@ struct Instruction {
impl Ram {
fn new() -> Self {
let mut mem = Vec::new();
mem.resize((RAM_SIZE - RAM_BASE) as usize, 0);
Self { mem }
Self {
mem: vec![0; (RAM_SIZE - RAM_BASE) as usize],
}
}
}