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
DolphinTool: Sensible changes #11951
Conversation
There was a problem hiding this 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:
| DiscIO::VolumeVerifier verifier(*volume, false, hashes_to_calculate); | ||
| verifier.Start(); | ||
| while (verifier.GetBytesProcessed() != verifier.GetTotalBytes()) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 &.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
8784d44
to
31e78c4
Compare
A subset of changes from #11943 which I believe to be most agreeable.