From 1c40e7aada6b32bbc621f06fb5f380149606a58d Mon Sep 17 00:00:00 2001 From: zxu Date: Mon, 5 Mar 2018 11:30:59 -0500 Subject: add converters and port paths to FSTQuery (#869) * add converters and fix FSTQuery.{h,m} only * address changes * a change forget to address * add a dummy function to make inline-only-library buildable --- Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Firestore/Source/Local/FSTMemoryRemoteDocumentCache.mm') 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 *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]; -- cgit v1.2.3