Skip to content

Avoid unnecessary big.Int assignment#292

Closed
jsign wants to merge 4 commits intoConsensys:developfrom
jsign:jsign/avoidassign
Closed

Avoid unnecessary big.Int assignment#292
jsign wants to merge 4 commits intoConsensys:developfrom
jsign:jsign/avoidassign

Conversation

@jsign
Copy link
Copy Markdown
Contributor

@jsign jsign commented Dec 23, 2022

This PR removes an unnecessary assignment to an output variable.

gbotrel and others added 4 commits October 21, 2022 17:20
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
@jsign jsign changed the title Avoid unnecessary big.Int assignement Avoid unnecessary big.Int assignment Dec 23, 2022
vv := bigIntPool.Get().(*big.Int)

// copy input + modular reduction
vv.Set(v)
Copy link
Copy Markdown
Contributor Author

@jsign jsign Dec 23, 2022

Choose a reason for hiding this comment

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

vv will be used as an output variable in the operation next line, so we can the value assignment.

@jsign jsign marked this pull request as ready for review December 23, 2022 00:17
@gbotrel gbotrel changed the base branch from master to develop January 4, 2023 13:54
@gbotrel gbotrel changed the base branch from develop to fix/avoidassign January 4, 2023 13:58
@gbotrel gbotrel changed the base branch from fix/avoidassign to develop January 4, 2023 13:59
gbotrel added a commit that referenced this pull request Jan 5, 2023
* docs: added audit.pdf and updated link in README

* internal/field: avoid unnecessary assignement

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* generate: run go generate

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* build: go generate no gkr for secp

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Youssef El Housni <youssef.elhousni@consensys.net>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
@gbotrel
Copy link
Copy Markdown
Collaborator

gbotrel commented Jan 5, 2023

cherry picked in #296

@gbotrel gbotrel closed this Jan 5, 2023
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.

5 participants