aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore
diff options
context:
space:
mode:
authorGravatar zxu <zxu@google.com>2017-12-12 11:35:08 -0500
committerGravatar Gil <mcg@google.com>2017-12-12 08:35:08 -0800
commit8f85bd199d2e3060605d2cede6409cedd7538cf5 (patch)
tree240a45713f2a83a445d25d42ebc2b4fea2569a22 /Firestore
parentcf4bda440f65939c9a3db7c45764868941b0abcd (diff)
Fix new warnings w.r.t. predicate query change (#555)
Diffstat (limited to 'Firestore')
-rw-r--r--Firestore/Source/API/FIRQuery+Internal.h2
-rw-r--r--Firestore/Source/API/FIRQuery.m15
2 files changed, 4 insertions, 13 deletions
diff --git a/Firestore/Source/API/FIRQuery+Internal.h b/Firestore/Source/API/FIRQuery+Internal.h
index b443c2f..3c2b2a7 100644
--- a/Firestore/Source/API/FIRQuery+Internal.h
+++ b/Firestore/Source/API/FIRQuery+Internal.h
@@ -23,8 +23,6 @@ NS_ASSUME_NONNULL_BEGIN
/** Internal FIRQuery API we don't want exposed in our public header files. */
@interface FIRQuery (Internal)
+ (FIRQuery *)referenceWithQuery:(FSTQuery *)query firestore:(FIRFirestore *)firestore;
-- (FIRQuery *)queryFilteredUsingComparisonPredicate:(NSPredicate *)predicate;
-- (FIRQuery *)queryFilteredUsingCompoundPredicate:(NSPredicate *)predicate;
@property(nonatomic, strong, readonly) FSTQuery *query;
@end
diff --git a/Firestore/Source/API/FIRQuery.m b/Firestore/Source/API/FIRQuery.m
index 70bd51e..bb1599a 100644
--- a/Firestore/Source/API/FIRQuery.m
+++ b/Firestore/Source/API/FIRQuery.m
@@ -259,9 +259,7 @@ addSnapshotListenerInternalWithOptions:(FSTListenOptions *)internalOptions
- (FIRQuery *)queryFilteredUsingComparisonPredicate:(NSPredicate *)predicate {
NSComparisonPredicate *comparison = (NSComparisonPredicate *)predicate;
if (comparison.comparisonPredicateModifier != NSDirectPredicateModifier) {
- FSTThrowInvalidArgument(
- @"Invalid query. Predicate cannot have an "
- "aggregate modifier.");
+ FSTThrowInvalidArgument(@"Invalid query. Predicate cannot have an aggregate modifier.");
}
NSString *path;
id value = nil;
@@ -301,15 +299,12 @@ addSnapshotListenerInternalWithOptions:(FSTListenOptions *)internalOptions
}
} else {
FSTThrowInvalidArgument(
- @"Invalid query. Predicate comparisons must "
- "include a key path and a constant.");
+ @"Invalid query. Predicate comparisons must include a key path and a constant.");
}
// Fallback cases of unsupported comparison operator.
switch (comparison.predicateOperatorType) {
case NSCustomSelectorPredicateOperatorType:
- FSTThrowInvalidArgument(
- @"Invalid query. Custom predicate filters are "
- "not supported.");
+ FSTThrowInvalidArgument(@"Invalid query. Custom predicate filters are not supported.");
break;
default:
FSTThrowInvalidArgument(@"Invalid query. Operator type %lu is not supported.",
@@ -320,9 +315,7 @@ addSnapshotListenerInternalWithOptions:(FSTListenOptions *)internalOptions
- (FIRQuery *)queryFilteredUsingCompoundPredicate:(NSPredicate *)predicate {
NSCompoundPredicate *compound = (NSCompoundPredicate *)predicate;
if (compound.compoundPredicateType != NSAndPredicateType || compound.subpredicates.count == 0) {
- FSTThrowInvalidArgument(
- @"Invalid query. Only compound queries using AND "
- "are supported.");
+ FSTThrowInvalidArgument(@"Invalid query. Only compound queries using AND are supported.");
}
FIRQuery *query = self;
for (NSPredicate *pred in compound.subpredicates) {