Skip to content

Commit e46a01d

Browse files
authored
ethdb/memorydb: allow noop compact on memdb (#19907)
* ethdb/memorydb: allow noop compact on memdb * ethdb/memorydb: fix comment type
1 parent 7f33625 commit e46a01d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ethdb/memorydb/memorydb.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,10 @@ func (db *Database) Stat(property string) (string, error) {
197197
return "", errors.New("unknown property")
198198
}
199199

200-
// Compact is not supported on a memory database.
200+
// Compact is not supported on a memory database, but there's no need either as
201+
// a memory database doesn't waste space anyway.
201202
func (db *Database) Compact(start []byte, limit []byte) error {
202-
return errors.New("unsupported operation")
203+
return nil
203204
}
204205

205206
// Len returns the number of entries currently present in the memory database.

0 commit comments

Comments
 (0)