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

DolphinTool: Sensible changes #11951

Merged

Conversation

Minty-Meeo
Copy link
Contributor

A subset of changes from #11943 which I believe to be most agreeable.

@Minty-Meeo Minty-Meeo marked this pull request as ready for review June 14, 2023 21:24
Copy link
Contributor

@AdmiralCurtiss AdmiralCurtiss left a comment

Choose a reason for hiding this comment

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

Rest is fine, but:

Comment on lines +87 to +89
DiscIO::VolumeVerifier verifier(*volume, false, hashes_to_calculate);
verifier.Start();
while (verifier.GetBytesProcessed() != verifier.GetTotalBytes())
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you pull this out of a function? This feels worse to me than before.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to avoid the copy of the DiscIO::VolumeVerifier::Result? In that case you forgot a &.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pulled it out of a function because it was wholly unnecessary for it to be outlined in the first place. For starters, it is only used once. It introduced an unnecessary failure state in the event that the DiscIO::VolumeDisc is a nullptr, which it never can be. Also, implementing the function inline took almost the same number of lines as it already took to call and check the result of VerifyCommand::VerifyVolume.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And also this can avoid copying result, which I didn't know was returned by const reference until you just mentioned it.

Copy link
Contributor

Choose a reason for hiding this comment

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

A function can be written simply for clarity even if it is only used once, or under the assumption that the functionality might be useful in another use case as well even if it doesn't exist at the moment.

Whatever, I think in this case it's not much of a difference either way, but your arguments feel a bit questionable to me.

@AdmiralCurtiss AdmiralCurtiss merged commit 98b5d72 into dolphin-emu:master Jun 17, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants