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

use extend_from_slice when appending multiple hashes to hash file #3497

Merged
merged 2 commits into from
Nov 24, 2020

Conversation

antiochp
Copy link
Member

This PR cleans up the Backend trait, passing a slice of hashes to append().

Pass &[Hash] into append() rather than Vec<Hash>.
This lets us call extend_from_slice() in VecBackend without cloning the vec of hashes.
In PMMR backend we can use the slice directly and append multiple hashes.

@antiochp antiochp requested a review from jaspervdm November 23, 2020 19:08
Copy link
Contributor

@jaspervdm jaspervdm left a comment

Choose a reason for hiding this comment

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

Looks like a good improvement 👍

@antiochp antiochp merged commit 2125c05 into mimblewimble:master Nov 24, 2020
@antiochp antiochp deleted the append_slice branch November 24, 2020 14:24
@antiochp antiochp mentioned this pull request Nov 26, 2020
bayk added a commit to mwcproject/mwc-node that referenced this pull request Jun 8, 2024
                  to hash file (mimblewimble#3497)

                 * use extend_from_slice when appending multiple hashes to hash file

                 * bump
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.

2 participants