@cryptotaxi247 / kubo / commits / d1237f1c9

blockstore: change order of newARCCachedBS parmaeters

so the context is first one License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

Jakub Sztandera committed Sep 6, 2016 at 08:03 UTC d1237f1c900829c503feb61e0e0204e5490a086a
3 files changed +3 -3
blocks/blockstore/arc_cache.go
+1 -1
@@ -19,7 +19,7 @@ type arccache struct {
19 total metrics.Counter
20 }
21
22 -func newARCCachedBS(bs Blockstore, ctx context.Context, lruSize int) (*arccache, error) {
22 +func newARCCachedBS(ctx context.Context, bs Blockstore, lruSize int) (*arccache, error) {
23 arc, err := lru.NewARC(lruSize)
24 if err != nil {
25 return nil, err
blocks/blockstore/arc_cache_test.go
+1 -1
@@ -140,7 +140,7 @@ func TestGetAndDeleteFalseShortCircuit(t *testing.T) {
140 }
141
142 func TestArcCreationFailure(t *testing.T) {
143 - if arc, err := newARCCachedBS(nil, context.TODO(), -1); arc != nil || err == nil {
143 + if arc, err := newARCCachedBS(context.TODO(), nil, -1); arc != nil || err == nil {
144 t.Fatal("expected error and no cache")
145 }
146 }
blocks/blockstore/caching.go
+1 -1
@@ -38,7 +38,7 @@ func CachedBlockstore(bs GCBlockstore,
38 ctx = metrics.CtxSubScope(ctx, "bs.cache")
39
40 if opts.HasARCCacheSize > 0 {
41 - cbs, err = newARCCachedBS(cbs, ctx, opts.HasARCCacheSize)
41 + cbs, err = newARCCachedBS(ctx, cbs, opts.HasARCCacheSize)
42 }
43 if opts.HasBloomFilterSize != 0 {
44 cbs, err = bloomCached(cbs, ctx, opts.HasBloomFilterSize, opts.HasBloomFilterHashes)