Skip to content

Commit 12aa03c

Browse files
author
Ibrahim Jarif
committed
Remove nil check in cache.Close and cache.clear
1 parent 349854e commit 12aa03c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

db.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,7 @@ func (db *DB) close() (err error) {
482482
db.elog.Printf("Waiting for closer")
483483
db.closers.updateSize.SignalAndWait()
484484
db.orc.Stop()
485-
if db.blockCache != nil {
486-
db.blockCache.Close()
487-
}
485+
db.blockCache.Close()
488486

489487
db.elog.Finish()
490488
if db.opt.InMemory {
@@ -1507,9 +1505,8 @@ func (db *DB) dropAll() (func(), error) {
15071505
db.vhead = valuePointer{} // Zero it out.
15081506
db.lc.nextFileID = 1
15091507
db.opt.Infof("Deleted %d value log files. DropAll done.\n", num)
1510-
if db.blockCache != nil {
1511-
db.blockCache.Clear()
1512-
}
1508+
db.blockCache.Clear()
1509+
15131510
return resume, nil
15141511
}
15151512

0 commit comments

Comments
 (0)