diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/bytes.go | 2 | ||||
-rw-r--r-- | common/math/dist_test.go | 36 |
2 files changed, 19 insertions, 19 deletions
diff --git a/common/bytes.go b/common/bytes.go index b9fb3b2da..cbceea8b5 100644 --- a/common/bytes.go +++ b/common/bytes.go @@ -143,7 +143,7 @@ func Hex2BytesFixed(str string, flen int) []byte { return h } else { if len(h) > flen { - return h[len(h)-flen : len(h)] + return h[len(h)-flen:] } else { hh := make([]byte, flen) copy(hh[flen-len(h):flen], h[:]) diff --git a/common/math/dist_test.go b/common/math/dist_test.go index 826faea8b..f5857b6f8 100644 --- a/common/math/dist_test.go +++ b/common/math/dist_test.go @@ -41,24 +41,24 @@ func TestSum(t *testing.T) { func TestDist(t *testing.T) { var vectors = []Vector{ - Vector{big.NewInt(1000), big.NewInt(1234)}, - Vector{big.NewInt(500), big.NewInt(10023)}, - Vector{big.NewInt(1034), big.NewInt(1987)}, - Vector{big.NewInt(1034), big.NewInt(1987)}, - Vector{big.NewInt(8983), big.NewInt(1977)}, - Vector{big.NewInt(98382), big.NewInt(1887)}, - Vector{big.NewInt(12398), big.NewInt(1287)}, - Vector{big.NewInt(12398), big.NewInt(1487)}, - Vector{big.NewInt(12398), big.NewInt(1987)}, - Vector{big.NewInt(12398), big.NewInt(128)}, - Vector{big.NewInt(12398), big.NewInt(1987)}, - Vector{big.NewInt(1398), big.NewInt(187)}, - Vector{big.NewInt(12328), big.NewInt(1927)}, - Vector{big.NewInt(12398), big.NewInt(1987)}, - Vector{big.NewInt(22398), big.NewInt(1287)}, - Vector{big.NewInt(1370), big.NewInt(1981)}, - Vector{big.NewInt(12398), big.NewInt(1957)}, - Vector{big.NewInt(42198), big.NewInt(1987)}, + {big.NewInt(1000), big.NewInt(1234)}, + {big.NewInt(500), big.NewInt(10023)}, + {big.NewInt(1034), big.NewInt(1987)}, + {big.NewInt(1034), big.NewInt(1987)}, + {big.NewInt(8983), big.NewInt(1977)}, + {big.NewInt(98382), big.NewInt(1887)}, + {big.NewInt(12398), big.NewInt(1287)}, + {big.NewInt(12398), big.NewInt(1487)}, + {big.NewInt(12398), big.NewInt(1987)}, + {big.NewInt(12398), big.NewInt(128)}, + {big.NewInt(12398), big.NewInt(1987)}, + {big.NewInt(1398), big.NewInt(187)}, + {big.NewInt(12328), big.NewInt(1927)}, + {big.NewInt(12398), big.NewInt(1987)}, + {big.NewInt(22398), big.NewInt(1287)}, + {big.NewInt(1370), big.NewInt(1981)}, + {big.NewInt(12398), big.NewInt(1957)}, + {big.NewInt(42198), big.NewInt(1987)}, } VectorsBy(GasSort).Sort(vectors) |