summaryrefslogtreecommitdiff
path: root/xdelta3/go/src/xdelta/rstream.go
diff options
context:
space:
mode:
Diffstat (limited to 'xdelta3/go/src/xdelta/rstream.go')
-rw-r--r--xdelta3/go/src/xdelta/rstream.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/xdelta3/go/src/xdelta/rstream.go b/xdelta3/go/src/xdelta/rstream.go
index 67d23e6..eafcfeb 100644
--- a/xdelta3/go/src/xdelta/rstream.go
+++ b/xdelta3/go/src/xdelta/rstream.go
@@ -7,15 +7,15 @@ import (
7) 7)
8 8
9const ( 9const (
10 blocksize = 16380 10 blocksize = 1<<20
11) 11)
12 12
13func WriteRstreams(t *TestGroup, desc string, seed, offset, len int64, 13func WriteRstreams(t *TestGroup, seed, offset, len int64,
14 src, tgt io.WriteCloser) { 14 src, tgt io.WriteCloser) {
15 t.Go("src-write:"+desc, func (g Goroutine) { 15 t.Go("src-write", func (g Goroutine) {
16 writeOne(g, seed, 0, len, src, false) 16 writeOne(g, seed, 0, len, src, false)
17 }) 17 })
18 t.Go("tgt-write:"+desc, func (g Goroutine) { 18 t.Go("tgt-write", func (g Goroutine) {
19 writeOne(g, seed, offset, len, tgt, true) 19 writeOne(g, seed, offset, len, tgt, true)
20 }) 20 })
21} 21}
@@ -60,9 +60,9 @@ func writeRand(r *rand.Rand, len int64, s io.Writer) error {
60} 60}
61 61
62func fillRand(r *rand.Rand, blk []byte) { 62func fillRand(r *rand.Rand, blk []byte) {
63 for p := 0; p < blocksize; { 63 for p := 0; p < len(blk); {
64 v := r.Int63() 64 v := r.Int63()
65 for i := 7; i != 0; i-- { 65 for i := 7; i != 0 && p < len(blk); i-- {
66 blk[p] = byte(v) 66 blk[p] = byte(v)
67 p++ 67 p++
68 v >>= 8 68 v >>= 8