@cryptotaxi247 / kubo / commits / cba00b900

fixes from review

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Feb 24, 2016 at 10:06 UTC cba00b900b32367a13f19199104a00df4abefd94
2 files changed +8 -9
core/commands/pin.go
+1 -1
@@ -33,7 +33,7 @@ type PinOutput struct {
33
34 var addPinCmd = &cmds.Command{
35 Helptext: cmds.HelpText{
36 - Tagline: "Pins objects to local storage.",
36 + Tagline: "Pins objects to local storage.",
37 ShortDescription: "Stores an IPFS object(s) from a given path locally to disk.",
38 },
39
merkledag/merkledag.go
+7 -8
@@ -146,14 +146,13 @@ func FindLinks(links []key.Key, k key.Key, start int) []int {
146 }
147
148 func (ds *dagService) GetMany(ctx context.Context, keys []key.Key) (<-chan *Node, <-chan error) {
149 - out := make(chan *Node)
149 + out := make(chan *Node, len(keys))
150 errs := make(chan error, 1)
151 blocks := ds.Blocks.GetBlocks(ctx, keys)
152 var count int
153
154 go func() {
155 defer close(out)
156 - defer close(errs)
156 for {
157 select {
158 case b, ok := <-blocks:
@@ -168,13 +167,13 @@ func (ds *dagService) GetMany(ctx context.Context, keys []key.Key) (<-chan *Node
167 errs <- err
168 return
169 }
171 - select {
172 - case out <- nd:
173 - count++
174 - case <-ctx.Done():
175 - return
176 - }
170 +
171 + // buffered, no need to select
172 + out <- nd
173 + count++
174 +
175 case <-ctx.Done():
176 + errs <- ctx.Err()
177 return
178 }
179 }