@@ -259,8 +259,9 @@ - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path isGreaterThanOrEqualTo:(i
259
259
- (FIRQuery *)queryFilteredUsingComparisonPredicate : (NSPredicate *)predicate {
260
260
NSComparisonPredicate *comparison = (NSComparisonPredicate *)predicate;
261
261
if (comparison.comparisonPredicateModifier != NSDirectPredicateModifier) {
262
- FSTThrowInvalidArgument (@" Invalid query. Predicate cannot have an "
263
- " aggregate modifier." );
262
+ FSTThrowInvalidArgument (
263
+ @" Invalid query. Predicate cannot have an "
264
+ " aggregate modifier." );
264
265
}
265
266
NSString *path;
266
267
id value = nil ;
@@ -279,8 +280,7 @@ - (FIRQuery *)queryFilteredUsingComparisonPredicate:(NSPredicate *)predicate {
279
280
return [self queryWhereField: path isGreaterThan: value];
280
281
case NSGreaterThanOrEqualToPredicateOperatorType:
281
282
return [self queryWhereField: path isGreaterThanOrEqualTo: value];
282
- default :
283
- ; // Fallback below to throw assertion.
283
+ default :; // Fallback below to throw assertion.
284
284
}
285
285
} else if ([comparison.leftExpression expressionType ] == NSConstantValueExpressionType &&
286
286
[comparison.rightExpression expressionType ] == NSKeyPathExpressionType) {
@@ -297,18 +297,19 @@ - (FIRQuery *)queryFilteredUsingComparisonPredicate:(NSPredicate *)predicate {
297
297
return [self queryWhereField: path isLessThan: value];
298
298
case NSGreaterThanOrEqualToPredicateOperatorType:
299
299
return [self queryWhereField: path isLessThanOrEqualTo: value];
300
- default :
301
- ; // Fallback below to throw assertion.
300
+ default :; // Fallback below to throw assertion.
302
301
}
303
302
} else {
304
- FSTThrowInvalidArgument (@" Invalid query. Predicate comparisons must "
305
- " include a key path and a constant." );
303
+ FSTThrowInvalidArgument (
304
+ @" Invalid query. Predicate comparisons must "
305
+ " include a key path and a constant." );
306
306
}
307
307
// Fallback cases of unsupported comparison operator.
308
308
switch (comparison.predicateOperatorType ) {
309
309
case NSCustomSelectorPredicateOperatorType:
310
- FSTThrowInvalidArgument (@" Invalid query. Custom predicate filters are "
311
- " not supported." );
310
+ FSTThrowInvalidArgument (
311
+ @" Invalid query. Custom predicate filters are "
312
+ " not supported." );
312
313
break ;
313
314
default :
314
315
FSTThrowInvalidArgument (@" Invalid query. Operator type %lu is not supported." ,
@@ -318,10 +319,10 @@ - (FIRQuery *)queryFilteredUsingComparisonPredicate:(NSPredicate *)predicate {
318
319
319
320
- (FIRQuery *)queryFilteredUsingCompoundPredicate : (NSPredicate *)predicate {
320
321
NSCompoundPredicate *compound = (NSCompoundPredicate *)predicate;
321
- if (compound.compoundPredicateType != NSAndPredicateType ||
322
- compound. subpredicates . count == 0 ) {
323
- FSTThrowInvalidArgument ( @" Invalid query. Only compound queries using AND "
324
- " are supported." );
322
+ if (compound.compoundPredicateType != NSAndPredicateType || compound. subpredicates . count == 0 ) {
323
+ FSTThrowInvalidArgument (
324
+ @" Invalid query. Only compound queries using AND "
325
+ " are supported." );
325
326
}
326
327
FIRQuery *query = self;
327
328
for (NSPredicate *pred in compound.subpredicates ) {
@@ -335,16 +336,19 @@ - (FIRQuery *)queryFilteredUsingPredicate:(NSPredicate *)predicate {
335
336
return [self queryFilteredUsingComparisonPredicate: predicate];
336
337
} else if ([predicate isKindOfClass: [NSCompoundPredicate class ]]) {
337
338
return [self queryFilteredUsingCompoundPredicate: predicate];
338
- } else if ([predicate isKindOfClass:
339
- [[NSPredicate predicateWithBlock:
340
- ^BOOL (id obj, NSDictionary *bindings) { return true ; }] class ]]) {
341
- FSTThrowInvalidArgument (@" Invalid query. Block-based predicates are not "
342
- " supported. Please use predicateWithFormat to "
343
- " create predicates instead." );
339
+ } else if ([predicate isKindOfClass: [[NSPredicate
340
+ predicateWithBlock: ^BOOL (id obj, NSDictionary *bindings) {
341
+ return true ;
342
+ }] class ]]) {
343
+ FSTThrowInvalidArgument (
344
+ @" Invalid query. Block-based predicates are not "
345
+ " supported. Please use predicateWithFormat to "
346
+ " create predicates instead." );
344
347
} else {
345
- FSTThrowInvalidArgument (@" Invalid query. Expect comparison or compound of "
346
- " comparison predicate. Please use "
347
- " predicateWithFormat to create predicates." );
348
+ FSTThrowInvalidArgument (
349
+ @" Invalid query. Expect comparison or compound of "
350
+ " comparison predicate. Please use "
351
+ " predicateWithFormat to create predicates." );
348
352
}
349
353
}
350
354
0 commit comments