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

Pass more arguments by reference #77

Merged
merged 11 commits into from
Jul 24, 2024
Merged

Pass more arguments by reference #77

merged 11 commits into from
Jul 24, 2024

Conversation

rillian
Copy link
Contributor

@rillian rillian commented Jul 23, 2024

General code clean up: change some functions to take arguments by reference instead of value so the call site doesn't have to call clone as much. Less cluttered source and avoids making unnecessary copies.

Much more to do in the direction, but this is a first pass.

rillian added 11 commits July 23, 2024 13:13
This was unused, and unncessary since the member variable is
public and can be accessed directly.
Avoid cloning these objects when the callee only needs temporary
access to the data.
Avoid cloning these objects when the callee only needs temporary
access to the data.
Take a few values by reference to avoid having to `clone()` them
at call sites, and simplify generator construction so it's more
clear how many copies are needed.
Make similar changes to the previous commit.
Remove further clone calls as an optimization.
Optimize and clean up argument passing to reduce the number of
clone calls.
Update function signatures to not require a clone of the `KeyPair`
struct when they only need temporary read access to the values.
Looks cleaner and should be more efficient.
Further clean up to remove clone method calls.
@rillian rillian requested a review from claucece July 23, 2024 20:19
@rillian rillian self-assigned this Jul 23, 2024
@claucece claucece requested a review from ankeleralph July 24, 2024 13:41
Copy link
Member

@claucece claucece left a comment

Choose a reason for hiding this comment

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

LGTM!

@rillian rillian merged commit 47907ed into main Jul 24, 2024
3 of 4 checks passed
@rillian rillian deleted the clone-1 branch July 24, 2024 15:22
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