You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When _s == 0, ['div', '_v', ['exp', 2, ['sub', 0, '_s']]] and ['mul', '_v', ['exp', 2, '_s']]]] are the same. But in the div branch, it need to execute sub which potentially costs more gas. Suggest using slt instead of sle. This will also ease the verification.
How can it be fixed?
change sle to slt
Cute Animal Picture
The text was updated successfully, but these errors were encountered:
jacqueswww
changed the title
Improve gas cost for shift funciton
Improve gas cost for shift function
Apr 10, 2018
What's your issue about?
shift
is compiled to the following code:When _s == 0,
['div', '_v', ['exp', 2, ['sub', 0, '_s']]] and ['mul', '_v', ['exp', 2, '_s']]]]
are the same. But in the div branch, it need to execute sub which potentially costs more gas. Suggest using slt instead of sle. This will also ease the verification.How can it be fixed?
change
sle
toslt
Cute Animal Picture
The text was updated successfully, but these errors were encountered: