Skip to content

Commit

Permalink
don't check validity of item while deleting it
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Jan 13, 2024
1 parent 3e74de5 commit 60dcdbd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/modules/Persistence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,13 @@ bool Persistence::deleteItem(const PersistentDataItem &item) {

CoreSuspender suspend;

auto range = store[item.entity_id()].equal_range(item.key());
int entity_id = item.entity_id();

auto range = store[entity_id].equal_range(item.key());
for (auto it = range.first; it != range.second; ++it) {
if (it->second->isReferencedBy(item)) {
entry_cache.erase(it->second->entry_id);
store[item.entity_id()].erase(it);
store[entity_id].erase(it);
break;
}
}
Expand Down

0 comments on commit 60dcdbd

Please sign in to comment.