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

Simplify some RTLIL destructors #2755

Merged
merged 1 commit into from
Jun 14, 2021
Merged

Conversation

rswarbrick
Copy link
Contributor

No change in behaviour, but use range-based for loops instead of
iterators.

(Note: This patch is part of the larger queue at #2752. The idea is to split things out to avoid having a giant PR to review all at once)

kernel/rtlil.cc Outdated
delete n;
for (auto &pr : modules_) delete pr.second;
for (auto n : verilog_packages) delete n;
for (auto n : verilog_globals) delete n;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is outside my main area, but I'm guessing the general preference would be to preserve the existing style of putting the body on its own line. I agree the range syntax (where possible) is superior, but the spacing is a matter of opinion, and the least chaotic move there would be to stick to the existing precedent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, ok. I've put the newlines back in. As you say, this simplifies the change (although the renaming means we still get diffs for all the lines, sadly).

No change in behaviour, but use range-based for loops instead of
iterators.
Copy link
Collaborator

@zachjs zachjs left a comment

Choose a reason for hiding this comment

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

I think this is an improvement and relatively low noise. I'm going to go ahead and merge this.

@zachjs zachjs merged commit 0811117 into YosysHQ:master Jun 14, 2021
@rswarbrick rswarbrick deleted the destructor branch June 14, 2021 16:07
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