all: simplify nested complexity and if blocks ending with a return statement (#21854)
Changes: Simplify nested complexity If an if blocks ends with a return statement then remove the else nesting. Most of the changes has also been reported in golint https://goreportcard.com/report/github.com/ethereum/go-ethereum#golint
This commit is contained in:
@@ -261,9 +261,8 @@ func (bt *BalanceTracker) storeBalance(id []byte, neg bool, value utils.ExpiredV
|
||||
func (bt *BalanceTracker) canDropBalance(now mclock.AbsTime, neg bool, b utils.ExpiredValue) bool {
|
||||
if neg {
|
||||
return b.Value(bt.negExp.LogOffset(now)) <= negThreshold
|
||||
} else {
|
||||
return b.Value(bt.posExp.LogOffset(now)) <= posThreshold
|
||||
}
|
||||
return b.Value(bt.posExp.LogOffset(now)) <= posThreshold
|
||||
}
|
||||
|
||||
// updateTotalBalance adjusts the total balance after executing given callback.
|
||||
|
Reference in New Issue
Block a user