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

Optimization: Pass SwitchCommitment by value instead of reference #3217

Merged
merged 1 commit into from
Feb 4, 2020

Conversation

quentinlesceller
Copy link
Member

As the title says, this PR changes the way we pass the SwitchCommitment enum: by value instead of reference.
Why? An enum is 1 byte in memory but a reference is 8 bytes.

@@ -109,7 +109,7 @@ impl Keychain for ExtKeychain {
ext_key = ext_key.ckd_priv(&self.secp, &mut h, p.path[i as usize])?;
}

match *switch {
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@antiochp antiochp 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 to me. I see no reason not to do this.

@quentinlesceller quentinlesceller merged commit ee25d0d into mimblewimble:master Feb 4, 2020
@antiochp antiochp mentioned this pull request Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants