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 { impl Ram {
fn new() -> Self { fn new() -> Self {
let mut mem = Vec::new(); Self {
mem.resize((RAM_SIZE - RAM_BASE) as usize, 0); mem: vec![0; (RAM_SIZE - RAM_BASE) as usize],
Self { mem } }
} }
} }