mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
chore: remove redunant nil check (#408)
This commit is contained in:
parent
326a8c8984
commit
976dd799ae
2 changed files with 2 additions and 2 deletions
|
|
@ -58,7 +58,7 @@ func NewBatchDatabaseWithEncode(datadir string, cacheLimit int) *BatchDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *BatchDatabase) IsEmptyKey(key []byte) bool {
|
func (db *BatchDatabase) IsEmptyKey(key []byte) bool {
|
||||||
return key == nil || len(key) == 0 || bytes.Equal(key, db.emptyKey)
|
return len(key) == 0 || bytes.Equal(key, db.emptyKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *BatchDatabase) getCacheKey(key []byte) string {
|
func (db *BatchDatabase) getCacheKey(key []byte) string {
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ func NewMongoDatabase(session *mgo.Session, dbName string, mongoURL string, repl
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *MongoDatabase) IsEmptyKey(key []byte) bool {
|
func (db *MongoDatabase) IsEmptyKey(key []byte) bool {
|
||||||
return key == nil || len(key) == 0 || bytes.Equal(key, db.emptyKey)
|
return len(key) == 0 || bytes.Equal(key, db.emptyKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *MongoDatabase) getCacheKey(key []byte) string {
|
func (db *MongoDatabase) getCacheKey(key []byte) string {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue