diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-03-23 16:22:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 16:22:56 +0800 |
commit | 3fa0fa713bc1508835bdecd7dea78ff09803e327 (patch) | |
tree | 6a5d4a7dcfd72489bd4f7df70f5188a636947c24 /trie | |
parent | 525116dbff916825463931361f75e75e955c12e2 (diff) | |
parent | f1534f5797664856218c8347366488f37f1e7924 (diff) | |
download | dexon-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar dexon-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar.gz dexon-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar.bz2 dexon-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar.lz dexon-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar.xz dexon-3fa0fa713bc1508835bdecd7dea78ff09803e327.tar.zst dexon-3fa0fa713bc1508835bdecd7dea78ff09803e327.zip |
Merge pull request #3809 from fjl/all-use-normal-context
all: import "context" instead of "golang.org/x/net/context"
Diffstat (limited to 'trie')
-rw-r--r-- | trie/trie_test.go | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/trie/trie_test.go b/trie/trie_test.go index 60307dba8..01ae3a4e7 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -377,7 +377,7 @@ func (randTest) Generate(r *rand.Rand, size int) reflect.Value { if len(allKeys) < 2 || r.Intn(100) < 10 { // new key key := make([]byte, r.Intn(50)) - randRead(r, key) + r.Read(key) allKeys = append(allKeys, key) return key } @@ -401,22 +401,6 @@ func (randTest) Generate(r *rand.Rand, size int) reflect.Value { return reflect.ValueOf(steps) } -// rand.Rand provides a Read method in Go 1.7 and later, but -// we can't use it yet. -func randRead(r *rand.Rand, b []byte) { - pos := 0 - val := 0 - for n := 0; n < len(b); n++ { - if pos == 0 { - val = r.Int() - pos = 7 - } - b[n] = byte(val) - val >>= 8 - pos-- - } -} - func runRandTest(rt randTest) bool { db, _ := ethdb.NewMemDatabase() tr, _ := New(common.Hash{}, db) |