aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/API/FIRQuery.mm
diff options
context:
space:
mode:
authorGravatar zxu <zxu@google.com>2018-03-06 14:28:04 -0500
committerGravatar GitHub <noreply@github.com>2018-03-06 14:28:04 -0500
commit8311c6432ecff78bedd13e27f64d241659324786 (patch)
tree982484ba69cf17172ee4e1308254a0b76894b7d5 /Firestore/Source/API/FIRQuery.mm
parent34ebf10b0acc65f1924d723e82085d4104bc281d (diff)
port paths to FSTDocumentKey (#877)
* replace path with C++ implementation in FSTDocumentKey.{h,mm} only * address changes * address changes
Diffstat (limited to 'Firestore/Source/API/FIRQuery.mm')
-rw-r--r--Firestore/Source/API/FIRQuery.mm9
1 files changed, 3 insertions, 6 deletions
diff --git a/Firestore/Source/API/FIRQuery.mm b/Firestore/Source/API/FIRQuery.mm
index 45ee482..c277561 100644
--- a/Firestore/Source/API/FIRQuery.mm
+++ b/Firestore/Source/API/FIRQuery.mm
@@ -469,8 +469,7 @@ addSnapshotListenerInternalWithOptions:(FSTListenOptions *)internalOptions
@"Invalid query. When querying by document ID you must provide "
"a valid document ID, but it was an empty string.");
}
- FSTResourcePath *path = [[FSTResourcePath resourcePathWithCPPResourcePath:self.query.path]
- pathByAppendingSegment:documentKey];
+ ResourcePath path = self.query.path.Append([documentKey UTF8String]);
fieldValue = [FSTReferenceValue referenceValue:[FSTDocumentKey keyWithPath:path]
databaseID:self.firestore.databaseID];
} else if ([value isKindOfClass:[FIRDocumentReference class]]) {
@@ -621,10 +620,8 @@ addSnapshotListenerInternalWithOptions:(FSTListenOptions *)internalOptions
FSTThrowInvalidUsage(@"InvalidQueryException",
@"Invalid query. Document ID '%@' contains a slash.", documentID);
}
- FSTDocumentKey *key = [FSTDocumentKey
- keyWithPath:[FSTResourcePath
- resourcePathWithCPPResourcePath:self.query.path.Append(
- [documentID UTF8String])]];
+ FSTDocumentKey *key =
+ [FSTDocumentKey keyWithPath:self.query.path.Append([documentID UTF8String])];
[components
addObject:[FSTReferenceValue referenceValue:key databaseID:self.firestore.databaseID]];
} else {