Skip to content

Commit

Permalink
use defer
Browse files Browse the repository at this point in the history
  • Loading branch information
july2993 committed Aug 7, 2019
1 parent c033ae6 commit 9c56122
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pump/storage/sorter.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,10 @@ func (s *sorter) setResolver(resolver func(startTS int64) bool) {
}

func (s *sorter) allMatched() bool {
var match bool

s.lock.Lock()
match = len(s.waitStartTS) == 0
s.lock.Unlock()
defer s.lock.Unlock()

return match
return len(s.waitStartTS) == 0
}

func (s *sorter) pushTSItem(item sortItem) {
Expand Down

0 comments on commit 9c56122

Please sign in to comment.