Skip to content

Commit

Permalink
don't heap allocate the cond, just set L
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Jul 13, 2021
1 parent 8384793 commit 997e004
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blockstore/badger/blockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ type Blockstore struct {
viewers sync.WaitGroup

moveMx sync.RWMutex
moveCond *sync.Cond
moveCond sync.Cond
moveState int
rlock int

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 997e004

Please sign in to comment.