Skip to content

Commit

Permalink
avoid unnecessary remove
Browse files Browse the repository at this point in the history
  • Loading branch information
lingol committed Jun 10, 2019
1 parent 6eb489f commit a3da351
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions iOS/MMKV/MMKV/MMKV.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,9 @@ - (void)removeValueForKey:(NSString *)key {
CScopedLock lock(m_lock);
[self checkLoadData];

if ([m_dic objectForKey:key] == nil) {
return;
}
[m_dic removeObjectForKey:key];
m_hasFullWriteBack = NO;

Expand Down

0 comments on commit a3da351

Please sign in to comment.