Commit 7519431e authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #55 from ipfs/kevina/buf-size-match

Make sure buffer size of wrapper datastores match underlying datastore.
parents 76c8200a de36f9a1
......@@ -60,7 +60,7 @@ func (d *ktds) Query(q dsq.Query) (dsq.Results, error) {
return nil, err
}
ch := make(chan dsq.Result)
ch := make(chan dsq.Result, cap(qr.Next()))
go func() {
defer close(ch)
defer qr.Close()
......
......@@ -58,12 +58,7 @@ func (d *datastore) Query(q dsq.Query) (dsq.Results, error) {
return nil, err
}
var ch chan dsq.Result
if q.KeysOnly {
ch = make(chan dsq.Result, dsq.KeysOnlyBufSize)
} else {
ch = make(chan dsq.Result)
}
ch := make(chan dsq.Result, cap(qr.Next()))
go func() {
defer close(ch)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment