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

⚡ minor arithmetic optimisation #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0xbyte0
Copy link

@0xbyte0 0xbyte0 commented Jul 29, 2022

2 ** n == 1 << n and bitwise operations are faster and would save gas since the function is called multiple times

I tried and made comparisons on Remix and the compiler doesn't optimise 2**n.

@0xbyte0 0xbyte0 changed the title ⚡ improved arthemetic ⚡ ⚡ improved arthemetic Jul 29, 2022
@0xbyte0 0xbyte0 changed the title ⚡ improved arthemetic ⚡ improved arthemetic Jul 29, 2022
@0xbyte0 0xbyte0 changed the title ⚡ improved arthemetic ⚡ minor arithmetic optimisation Jul 29, 2022
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.

1 participant