What I understand till now is, checking for only 1 variable == 0 costs lowest gas out of
1.) doing this test for none of them. Gas = X
2.) Doing this test only for 1 variable Gas = X-1
3.) Doing this test for both variables Gas = X

Oct 5, 2021, 9:08 AM
this
Oct 5, 2021, 9:08 AM
Yup
Oct 5, 2021, 9:08 AM
that's why 2 case is best
Oct 5, 2021, 9:08 AM
Ye
Oct 5, 2021, 9:08 AM
Thanks, got it now, you denied on this so I got confused again
😅
Oct 5, 2021, 9:09 AM
1 of them I wrong
If in some way a == 0 then it's gonna cost less
I think that's why they did that
If b == 0 then the code can catch errors
Oct 5, 2021, 9:12 AM
Nope
test says
If b== 0 will be in code
then it will again cost same gas as per earlier
so no benefit of the case a==0
this
Oct 5, 2021, 9:33 AM
Idk then
Oct 5, 2021, 10:44 AM
np
thanks for the discussion on it
Oct 5, 2021, 10:45 AM

© 2024 Draquery.com All rights reserved.