Skip to content

Commit

Permalink
fix: fix pedantic returns in Pebble
Browse files Browse the repository at this point in the history
Removes pedantic returns that are non-idiomatic Go.

Fixes cosmos#94
  • Loading branch information
odeke-em committed Oct 26, 2023
1 parent 81c032d commit bdc1b1a
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,7 @@ func (db *PebbleDB) Delete(key []byte) error {
if isForceSync {
wopts = pebble.Sync
}
err := db.db.Delete(key, wopts)
if err != nil {
return err
}
return nil
return db.db.Delete(key, wopts)
}

// DeleteSync implements DB.
Expand All @@ -190,11 +186,7 @@ func (db PebbleDB) DeleteSync(key []byte) error {
if len(key) == 0 {
return errKeyEmpty
}
err := db.db.Delete(key, pebble.Sync)
if err != nil {
return nil
}
return nil
return db.db.Delete(key, pebble.Sync)
}

func (db *PebbleDB) DB() *pebble.DB {
Expand Down Expand Up @@ -488,11 +480,7 @@ func (itr *pebbleDBIterator) Error() error {
// Close implements Iterator.
func (itr *pebbleDBIterator) Close() error {
// fmt.Println("pebbleDBIterator.Close")
err := itr.source.Close()
if err != nil {
return err
}
return nil
return itr.source.Close()
}

func (itr *pebbleDBIterator) assertIsValid() {
Expand Down

0 comments on commit bdc1b1a

Please sign in to comment.