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

Larger cleanup to input-related source files (this time using unique_ptr). #23

Merged
merged 5 commits into from Feb 2, 2014

Conversation

lioncash
Copy link
Member

@lioncash lioncash commented Feb 2, 2014

I took delroth's suggestion of using unique_ptr as well. However this required changes outside of InputComment to be done, and thus warranted it's own new branch (the previous one was called "small-inputcommon-cleanup" which would be inaccurate with the new changes)

This is open at the same time as PR #17 in case this one proves to be too messy (by opinion of course), then this one can be dropped and PR #17 can be used instead.

Anyway, feel free to point out anything that seems weird.

…erators that litter this section of the codebase.

Also clean up a little bit of the comments that describe the interface classes.
…lass. Allows for the automatic handling of resource deallocation.
Changes a bunch of for+iterator loops into foreach loops.
@lioncash
Copy link
Member Author

lioncash commented Feb 2, 2014

@BhaaLseN emplace_back and iterating by reference avoids the use of std::move :)

@BhaaLseN
Copy link
Member

BhaaLseN commented Feb 2, 2014

Ok, nvm then :)

@lioncash
Copy link
Member Author

lioncash commented Feb 2, 2014

@BhaaLseN Actually, I'm not so sure. When I replied to your comment, I thought it was a general response, not a specific line comment :x. My bad. I think the current code in the initializer list is correct, but I'm open to being corrected.

If anyone can clarify if it's necessary, that would be awesome.

@delroth
Copy link
Member

delroth commented Feb 2, 2014

std::move is only needed when create a unique_ptr from another unique_ptr (and it will invalidate the previous unique_ptr - there can be only one unique_ptr pointing to an object). In this case it should be ok since the pointer is passed directly.

Also, LGTM.

@lioncash
Copy link
Member Author

lioncash commented Feb 2, 2014

@delroth Thanks for the clarification :)

delroth added a commit that referenced this pull request Feb 2, 2014
Larger cleanup to input-related source files (this time using unique_ptr).
@delroth delroth merged commit 3363b39 into dolphin-emu:master Feb 2, 2014
@lioncash lioncash deleted the sorta-large-input-cleanup branch February 2, 2014 23:14
@ghost ghost mentioned this pull request Feb 11, 2021
rapito pushed a commit to project-lylat/dolphin that referenced this pull request Jun 16, 2022
Beta Version Changes from LittleCoaks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants