Skip to content

Commit

Permalink
Fix clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Dec 22, 2024
1 parent 2bb79fa commit 9878660
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class MemoryLevel extends AbstractLevel {
}

async _clear (options) {
if (options.limit === -1 && !Object.keys(options).some(isRangeOption)) {
if (options.limit === -1 && !Object.keys(options).some(isRangeOption) && !options.snapshot) {
// Delete everything by creating a new empty tree.
this[kTree] = createRBT(compare)
return
Expand Down

0 comments on commit 9878660

Please sign in to comment.