Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: memory table cleanup #64

Merged
merged 4 commits into from
Nov 14, 2024
Merged

Conversation

zmalatrax
Copy link
Collaborator

Removes unnecessary methods from MemoryTable, makes fields and methods private.

It also refactors the way registers are added to the memory table in From<Vec> for MemoryTable

I'm half convinced of the proposed design to create MemoryTableRow out of Registers, with From<(&Register, bool)> for MemorytTableRow

Comment on lines 145 to 147
let memory_rows: Vec<MemoryTableRow> =
registers.iter().map(|reg| MemoryTableRow::from((reg, false))).collect();
memory_table.add_rows(memory_rows);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let memory_rows: Vec<MemoryTableRow> =
registers.iter().map(|reg| MemoryTableRow::from((reg, false))).collect();
memory_table.add_rows(memory_rows);
let memory_rows =
registers.iter().map(|reg| (reg, false).into()).collect();
memory_table.add_rows(memory_rows);

@tcoratger tcoratger merged commit c87b629 into main Nov 14, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants