diff options
Diffstat (limited to 'Firestore/Source/Local/FSTLocalStore.mm')
-rw-r--r-- | Firestore/Source/Local/FSTLocalStore.mm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Firestore/Source/Local/FSTLocalStore.mm b/Firestore/Source/Local/FSTLocalStore.mm index f61a20f..922f281 100644 --- a/Firestore/Source/Local/FSTLocalStore.mm +++ b/Firestore/Source/Local/FSTLocalStore.mm @@ -34,7 +34,6 @@ #import "Firestore/Source/Local/FSTWriteGroup.h" #import "Firestore/Source/Model/FSTDocument.h" #import "Firestore/Source/Model/FSTDocumentDictionary.h" -#import "Firestore/Source/Model/FSTDocumentKey.h" #import "Firestore/Source/Model/FSTMutation.h" #import "Firestore/Source/Model/FSTMutationBatch.h" #import "Firestore/Source/Remote/FSTRemoteEvent.h" @@ -43,8 +42,10 @@ #include "Firestore/core/src/firebase/firestore/auth/user.h" #include "Firestore/core/src/firebase/firestore/core/target_id_generator.h" +#include "Firestore/core/src/firebase/firestore/model/document_key.h" using firebase::firestore::auth::User; +using firebase::firestore::model::DocumentKey; using firebase::firestore::core::TargetIdGenerator; NS_ASSUME_NONNULL_BEGIN @@ -387,7 +388,7 @@ NS_ASSUME_NONNULL_BEGIN return [self.mutationQueue nextMutationBatchAfterBatchID:batchID]; } -- (nullable FSTMaybeDocument *)readDocument:(FSTDocumentKey *)key { +- (nullable FSTMaybeDocument *)readDocument:(const DocumentKey &)key { return [self.localDocuments documentForKey:key]; } @@ -458,9 +459,9 @@ NS_ASSUME_NONNULL_BEGIN FSTWriteGroup *group = [self.persistence startGroupWithAction:@"Garbage Collection"]; // Call collectGarbage regardless of whether isGCEnabled so the referenceSet doesn't continue to // accumulate the garbage keys. - NSSet<FSTDocumentKey *> *garbage = [self.garbageCollector collectGarbage]; - if (garbage.count > 0) { - for (FSTDocumentKey *key in garbage) { + std::set<DocumentKey> garbage = [self.garbageCollector collectGarbage]; + if (garbage.size() > 0) { + for (const DocumentKey &key : garbage) { [self.remoteDocumentCache removeEntryForKey:key group:group]; } } @@ -527,7 +528,7 @@ NS_ASSUME_NONNULL_BEGIN for (FSTMutationBatch *batch in batches) { for (FSTMutation *mutation in batch.mutations) { - FSTDocumentKey *key = mutation.key; + const DocumentKey &key = mutation.key; affectedDocs = [affectedDocs setByAddingObject:key]; } } |