remade compare_machine_memory
This commit is contained in:
parent
58890d85d1
commit
de0013ad3e
@ -220,17 +220,16 @@ impl MemChecker{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Compare sections of a memChecker and a machine memory
|
||||||
|
///
|
||||||
|
/// ### Parameters
|
||||||
|
///
|
||||||
|
/// - **m_c** contains section of the memory checker
|
||||||
|
/// - **machine** contains the main memory
|
||||||
pub fn compare_machine_memory(m_c: &MemChecker, machine: &Machine) -> bool {
|
pub fn compare_machine_memory(m_c: &MemChecker, machine: &Machine) -> bool {
|
||||||
|
m_c.sections.iter().map(|section| {
|
||||||
for section in m_c.sections.iter() {
|
!(0..section.len).into_iter().all(|i| machine.main_memory[section.addr + i] == section.content[i])
|
||||||
for i in 0..section.len {
|
}).all(|e| e == true)
|
||||||
if machine.main_memory[section.addr + i] != section.content[i] {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user