Skip to content

Commit

Permalink
Remove nil check in cache.Close and cache.clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibrahim Jarif committed Jan 16, 2020
1 parent 349854e commit 12aa03c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,7 @@ func (db *DB) close() (err error) {
db.elog.Printf("Waiting for closer")
db.closers.updateSize.SignalAndWait()
db.orc.Stop()
if db.blockCache != nil {
db.blockCache.Close()
}
db.blockCache.Close()

db.elog.Finish()
if db.opt.InMemory {
Expand Down Expand Up @@ -1507,9 +1505,8 @@ func (db *DB) dropAll() (func(), error) {
db.vhead = valuePointer{} // Zero it out.
db.lc.nextFileID = 1
db.opt.Infof("Deleted %d value log files. DropAll done.\n", num)
if db.blockCache != nil {
db.blockCache.Clear()
}
db.blockCache.Clear()

return resume, nil
}

Expand Down

0 comments on commit 12aa03c

Please sign in to comment.