improve memory initialization
This commit is contained in:
parent
4731e932cc
commit
5e961163c4
|
@ -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],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue