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

refactor(storage-proofs-porep): improve unsafe code structure #1295

Closed
wants to merge 3 commits into from

Conversation

dignifiedquire
Copy link
Contributor

No description provided.

self.get_mut_bufs()[replace_idx] = new_buf;
}
let buf = if new_window % 2 == 0 {
&mut *self.buf0.get()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the buf should be alternating with this conditional, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes it should

@porcuquine
Copy link
Collaborator

This seems to mainly replace % operations with manual if-else statements, adding verbosity. I think the original code actually does exactly what we want and generalizes to more than two buffers. Not that we need more than two in practice, but that's an example of why I don't think we inherently need to special-case this. The general handling accurately and concisely does exactly what is needed.

@dignifiedquire
Copy link
Contributor Author

not merging for now

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.

3 participants