Open code423n4 opened 2 years ago
JBTokenStore.sol line 242 Short Circuiting optimization:
The order of the functions inside the if statement in line 242:
if (_token == IJBToken(address(0)) && requireClaimFor[_projectId])
can be switched to:
if (requireClaimFor[_projectId] && _token == IJBToken(address(0)))
for optimal gas usage because requireClaimFor is more probable to be FALSE hence second one won’t be executed and hence save you gas.
Indeed, good catch!
JBTokenStore.sol line 242 Short Circuiting optimization:
The order of the functions inside the if statement in line 242:
if (_token == IJBToken(address(0)) && requireClaimFor[_projectId])
can be switched to:
if (requireClaimFor[_projectId] && _token == IJBToken(address(0)))
for optimal gas usage because requireClaimFor is more probable to be FALSE hence second one won’t be executed and hence save you gas.