aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source
diff options
context:
space:
mode:
authorGravatar Sebastian Schmidt <mrschmidt@google.com>2017-12-10 23:07:53 -0800
committerGravatar Sebastian Schmidt <mrschmidt@google.com>2017-12-10 23:07:53 -0800
commite23236bd389d73beccb3a2e5b823873ba25b1b62 (patch)
tree3c08d227ac459c886e1c50107bfab870867cfcd1 /Firestore/Source
parentdea9c23bfcc4aef53949813dfcedb57573e86a95 (diff)
Running scripts/style.sh
Diffstat (limited to 'Firestore/Source')
-rw-r--r--Firestore/Source/API/FIRQuery.m50
1 files changed, 27 insertions, 23 deletions
diff --git a/Firestore/Source/API/FIRQuery.m b/Firestore/Source/API/FIRQuery.m
index 9ab854a..70bd51e 100644
--- a/Firestore/Source/API/FIRQuery.m
+++ b/Firestore/Source/API/FIRQuery.m
@@ -259,8 +259,9 @@ 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;
@@ -279,8 +280,7 @@ addSnapshotListenerInternalWithOptions:(FSTListenOptions *)internalOptions
return [self queryWhereField:path isGreaterThan:value];
case NSGreaterThanOrEqualToPredicateOperatorType:
return [self queryWhereField:path isGreaterThanOrEqualTo:value];
- default:
- ; // Fallback below to throw assertion.
+ default:; // Fallback below to throw assertion.
}
} else if ([comparison.leftExpression expressionType] == NSConstantValueExpressionType &&
[comparison.rightExpression expressionType] == NSKeyPathExpressionType) {
@@ -297,18 +297,19 @@ addSnapshotListenerInternalWithOptions:(FSTListenOptions *)internalOptions
return [self queryWhereField:path isLessThan:value];
case NSGreaterThanOrEqualToPredicateOperatorType:
return [self queryWhereField:path isLessThanOrEqualTo:value];
- default:
- ; // Fallback below to throw assertion.
+ default:; // Fallback below to throw assertion.
}
} else {
- FSTThrowInvalidArgument(@"Invalid query. Predicate comparisons must "
- "include a key path and a constant.");
+ FSTThrowInvalidArgument(
+ @"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.",
@@ -318,10 +319,10 @@ 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.");
+ if (compound.compoundPredicateType != NSAndPredicateType || compound.subpredicates.count == 0) {
+ FSTThrowInvalidArgument(
+ @"Invalid query. Only compound queries using AND "
+ "are supported.");
}
FIRQuery *query = self;
for (NSPredicate *pred in compound.subpredicates) {
@@ -335,16 +336,19 @@ addSnapshotListenerInternalWithOptions:(FSTListenOptions *)internalOptions
return [self queryFilteredUsingComparisonPredicate:predicate];
} else if ([predicate isKindOfClass:[NSCompoundPredicate class]]) {
return [self queryFilteredUsingCompoundPredicate:predicate];
- } else if ([predicate isKindOfClass:
- [[NSPredicate predicateWithBlock:
- ^BOOL(id obj, NSDictionary *bindings) { return true; }] class]]) {
- FSTThrowInvalidArgument(@"Invalid query. Block-based predicates are not "
- "supported. Please use predicateWithFormat to "
- "create predicates instead.");
+ } else if ([predicate isKindOfClass:[[NSPredicate
+ predicateWithBlock:^BOOL(id obj, NSDictionary *bindings) {
+ return true;
+ }] class]]) {
+ FSTThrowInvalidArgument(
+ @"Invalid query. Block-based predicates are not "
+ "supported. Please use predicateWithFormat to "
+ "create predicates instead.");
} else {
- FSTThrowInvalidArgument(@"Invalid query. Expect comparison or compound of "
- "comparison predicate. Please use "
- "predicateWithFormat to create predicates.");
+ FSTThrowInvalidArgument(
+ @"Invalid query. Expect comparison or compound of "
+ "comparison predicate. Please use "
+ "predicateWithFormat to create predicates.");
}
}