> 0 can be replaced with != 0 for gas optimisation #49
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
G (Gas Optimization)
Handle
pedroais
Vulnerability details
Impact
!= 0 is a cheaper operation compared to > 0, when dealing with uint.
Occurences
Streaming/src/Locke.sol: 226: if (acctTimeDelta > 0 && ts.tokens > 0) {
Streaming/src/Locke.sol: 236: if (tdelta > 0 && unstreamed > 0) {
Streaming/src/Locke.sol: 378: require(amount > 0, "amt");
Streaming/src/Locke.sol: 418: require(amount > 0, "amt");
Streaming/src/Locke.sol: 456: require(amount > 0, "amt");
Streaming/src/Locke.sol: 522: require(amount > 0, "amt");
Streaming/src/Locke.sol: 572: require(rewardAmt > 0, "amt");
Streaming/src/Locke.sol: 612: if (fees > 0) {
Streaming/src/Locke.sol: 226: if (fees > 0) {
Streaming/src/Locke.sol: 612: if (incentives[token] > 0) {
Streaming/src/Locke.sol: 679: if (acctTimeDelta > 0 && ts.tokens > 0) {
The text was updated successfully, but these errors were encountered: