aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm')
-rw-r--r--Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm b/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm
index 9bbc047..7d5e1e2 100644
--- a/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm
+++ b/Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm
@@ -60,10 +60,11 @@ NS_ASSUME_NONNULL_BEGIN
// Documents are ordered by key, so we can use a prefix scan to narrow down the documents
// we need to match the query against.
- FSTDocumentKey *prefix = [FSTDocumentKey keyWithPath:[query.path pathByAppendingSegment:@""]];
+ FSTDocumentKey *prefix = [FSTDocumentKey
+ keyWithPath:[FSTResourcePath resourcePathWithCPPResourcePath:query.path.Append("")]];
NSEnumerator<FSTDocumentKey *> *enumerator = [self.docs keyEnumeratorFrom:prefix];
for (FSTDocumentKey *key in enumerator) {
- if (![query.path isPrefixOfPath:key.path]) {
+ if (!query.path.IsPrefixOf([key.path toCPPResourcePath])) {
break;
}
FSTMaybeDocument *maybeDoc = self.docs[key];