From f374662c72b2255081f17f3ef7012debde74045b Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 13 Jul 2021 12:10:32 +0300 Subject: [PATCH] don't heap allocate the cond, just set L --- blockstore/badger/blockstore.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockstore/badger/blockstore.go b/blockstore/badger/blockstore.go index 776cf6a0b81..6db9287c3d0 100644 --- a/blockstore/badger/blockstore.go +++ b/blockstore/badger/blockstore.go @@ -96,7 +96,7 @@ type Blockstore struct { viewers sync.WaitGroup moveMx sync.RWMutex - moveCond *sync.Cond + moveCond sync.Cond moveState int rlock int @@ -135,7 +135,7 @@ func Open(opts Options) (*Blockstore, error) { bs.prefixLen = len(bs.prefix) } - bs.moveCond = sync.NewCond(&bs.moveMx) + bs.moveCond.L = &bs.moveMx return bs, nil }