@cryptotaxi247 / kubo / commits / 9543ed6ca

blockstore: cleanup style a bit

License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

Jakub Sztandera committed Aug 2, 2016 at 10:59 UTC 9543ed6ca1c8ceea157eef9d24d3f536362d6cd9
1 file changed +6 -5
blocks/blockstore/arc_cache.go
+6 -5
@@ -102,12 +102,13 @@ func (b *arccache) PutMany(bs []blocks.Block) error {
102 }
103 }
104 err := b.blockstore.PutMany(bs)
105 - if err == nil {
106 - for _, block := range bs {
107 - b.arc.Add(block.Key(), true)
108 - }
105 + if err != nil {
106 + return err
107 }
110 - return err
108 + for _, block := range bs {
109 + b.arc.Add(block.Key(), true)
110 + }
111 + return nil
112 }
113
114 func (b *arccache) AllKeysChan(ctx context.Context) (<-chan key.Key, error) {