forked from cerc-io/plugeth
all: prefer new(big.Int) over big.NewInt(0) (#25087)
minor performance improvement: `big.NewInt(0).Xxx` -> `new(big.Int).Xxx`
This commit is contained in:
@@ -103,7 +103,7 @@ func TestDifficultyCalculators(t *testing.T) {
|
||||
for i := 0; i < 5000; i++ {
|
||||
// 1 to 300 seconds diff
|
||||
var timeDelta = uint64(1 + rand.Uint32()%3000)
|
||||
diffBig := big.NewInt(0).SetBytes(randSlice(2, 10))
|
||||
diffBig := new(big.Int).SetBytes(randSlice(2, 10))
|
||||
if diffBig.Cmp(params.MinimumDifficulty) < 0 {
|
||||
diffBig.Set(params.MinimumDifficulty)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user