Skip to content

Commit

Permalink
fixing wasm index clear issue with reverse order
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivy committed Jul 26, 2024
1 parent fd3032a commit 162c825
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/local_storage_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl StoreImpl for LocalStorageStore {
let storage = self.storage();
let length = storage.length().map_err(SetError::Clear)?;
let prefix = &self.prefix;
for index in 0..length {
for index in (0..length).rev() {
if let Some(key) = storage.key(index).map_err(SetError::Clear)? {
if key.starts_with(prefix) {
storage.remove_item(&key).map_err(SetError::Clear)?;
Expand Down

0 comments on commit 162c825

Please sign in to comment.