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

Little Gas Optimization #117

Merged
merged 2 commits into from
Aug 16, 2022
Merged

Little Gas Optimization #117

merged 2 commits into from
Aug 16, 2022

Conversation

TradMod
Copy link
Contributor

@TradMod TradMod commented Aug 13, 2022

Description

++i costs a little less gas than i++
As i++ returns the non-incremented value & ++i returns the incremented value.

Related Issue

N/A

Does this introduce a breaking change?

  • Yes
  • No

Other information

For More info check this: https://ethereum.stackexchange.com/questions/133161/why-does-i-cost-less-gas-than-i

And here are the gas snapshots,
Before:
semaphoreBefore
After:
semaphoreAfter

Thanks,
AB Dee

P.S. I only changed 3 lines of code, other additions and deletions are just prettier's thing xD

@cedoor
Copy link
Member

cedoor commented Aug 16, 2022

Hi @DevABDee , thanks for this PR. Could you run yarn prettier:write and format your code?

@cedoor cedoor added the performance 📈 A code change that improves the performance label Aug 16, 2022
@TradMod
Copy link
Contributor Author

TradMod commented Aug 16, 2022

DONE!!! Thanks, @cedoor for the guidance. Now all checks passed :)

@cedoor cedoor self-requested a review August 16, 2022 18:56
@cedoor cedoor merged commit 96608b5 into semaphore-protocol:main Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance 📈 A code change that improves the performance
Projects
No open projects
Status: ✔️ Done
Development

Successfully merging this pull request may close these issues.

2 participants