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

cleanup: remove unnecessary unique_ptr<ostream> #5077

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FanShupei
Copy link
Contributor

I find lots of unique_ptr<ostream> in code, the unique_ptr indirection seems unnecessary and *os everywhere clutters code.

So I decide to remove it. I feel it generally makes code cleaner.

The rest changes simply fix up compile errors. It's massive but straightforward. No functional change is expected.

Copy link
Member

@wsnyder wsnyder left a comment

Choose a reason for hiding this comment

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

Some of these might be OK, but in general we want to still allow the/a future V3File destructor to be called correctly when the file is closed, and most of these changes I think will prevent that from properly happening.

Comment on lines +317 to +318
ofp = V3File::new_ofstream(vppfilename);
osp = &ofp;
Copy link
Member

Choose a reason for hiding this comment

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

Example of where destructor won't get properly called.

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.

None yet

2 participants