Skip to content

Commit 100c811

Browse files
committed
Pretty
1 parent 2d25442 commit 100c811

File tree

3 files changed

+38
-42
lines changed

3 files changed

+38
-42
lines changed

firestore/src/android/filter_android.cc

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
#include "firestore/src/android/filter_android.h"
2020

2121
#include "firestore/src/android/converter_android.h"
22-
#include "firestore/src/android/firestore_android.h"
2322
#include "firestore/src/android/field_path_android.h"
2423
#include "firestore/src/android/field_value_android.h"
24+
#include "firestore/src/android/firestore_android.h"
2525

2626
#include "firestore/src/jni/array.h"
2727
#include "firestore/src/jni/array_list.h"
@@ -37,8 +37,8 @@ using jni::Array;
3737
using jni::ArrayList;
3838
using jni::Env;
3939
using jni::Local;
40-
using jni::StaticMethod;
4140
using jni::Object;
41+
using jni::StaticMethod;
4242

4343
constexpr char kClassName[] =
4444
PROGUARD_KEEP_CLASS "com/google/firebase/firestore/Filter";
@@ -74,80 +74,78 @@ StaticMethod<Object> kArrayContainsAny(
7474
"arrayContainsAny",
7575
"(Lcom/google/firebase/firestore/FieldPath;Ljava/util/List;)"
7676
"Lcom/google/firebase/firestore/Filter;");
77-
StaticMethod<Object> kIn("in",
78-
"(Lcom/google/firebase/firestore/FieldPath;Ljava/util/List;)"
79-
"Lcom/google/firebase/firestore/Filter;");
77+
StaticMethod<Object> kIn(
78+
"in",
79+
"(Lcom/google/firebase/firestore/FieldPath;Ljava/util/List;)"
80+
"Lcom/google/firebase/firestore/Filter;");
8081
StaticMethod<Object> kNotIn(
8182
"notIn",
8283
"(Lcom/google/firebase/firestore/FieldPath;Ljava/util/List;)"
8384
"Lcom/google/firebase/firestore/Filter;");
84-
StaticMethod<Object> kAnd(
85-
"and",
86-
"([Lcom/google/firebase/firestore/Filter;)"
87-
"Lcom/google/firebase/firestore/Filter;");
88-
StaticMethod<Object> kOr(
89-
"or",
90-
"([Lcom/google/firebase/firestore/Filter;)"
91-
"Lcom/google/firebase/firestore/Filter;");
85+
StaticMethod<Object> kAnd("and",
86+
"([Lcom/google/firebase/firestore/Filter;)"
87+
"Lcom/google/firebase/firestore/Filter;");
88+
StaticMethod<Object> kOr("or",
89+
"([Lcom/google/firebase/firestore/Filter;)"
90+
"Lcom/google/firebase/firestore/Filter;");
9291
} // namespace
9392

9493
void FilterInternal::Initialize(jni::Loader& loader) {
95-
loader.LoadClass(
96-
kClassName, kEqualTo, kNotEqualTo, kLessThan, kLessThanOrEqualTo,
97-
kGreaterThan, kGreaterThanOrEqualTo, kArrayContains, kArrayContainsAny,
98-
kIn, kNotIn, kAnd, kOr);
94+
loader.LoadClass(kClassName, kEqualTo, kNotEqualTo, kLessThan,
95+
kLessThanOrEqualTo, kGreaterThan, kGreaterThanOrEqualTo,
96+
kArrayContains, kArrayContainsAny, kIn, kNotIn, kAnd, kOr);
9997
}
10098

10199
FilterInternal::FilterInternal(jni::Object&& object, bool is_empty)
102100
: object_(object), is_empty_(is_empty) {}
103101

104102
Filter FilterInternal::EqualTo(const FieldPath& field,
105-
const FieldValue& value) {
103+
const FieldValue& value) {
106104
return Where(field, kEqualTo, value);
107105
}
108106

109107
Filter FilterInternal::NotEqualTo(const FieldPath& field,
110-
const FieldValue& value) {
108+
const FieldValue& value) {
111109
return Where(field, kNotEqualTo, value);
112110
}
113111

114112
Filter FilterInternal::LessThan(const FieldPath& field,
115-
const FieldValue& value) {
113+
const FieldValue& value) {
116114
return Where(field, kLessThan, value);
117115
}
118116

119117
Filter FilterInternal::LessThanOrEqualTo(const FieldPath& field,
120-
const FieldValue& value) {
118+
const FieldValue& value) {
121119
return Where(field, kLessThanOrEqualTo, value);
122120
}
123121

124122
Filter FilterInternal::GreaterThan(const FieldPath& field,
125-
const FieldValue& value) {
123+
const FieldValue& value) {
126124
return Where(field, kGreaterThan, value);
127125
}
128126

129127
Filter FilterInternal::GreaterThanOrEqualTo(const FieldPath& field,
130-
const FieldValue& value) {
128+
const FieldValue& value) {
131129
return Where(field, kGreaterThanOrEqualTo, value);
132130
}
133131

134132
Filter FilterInternal::ArrayContains(const FieldPath& field,
135-
const FieldValue& value) {
133+
const FieldValue& value) {
136134
return Where(field, kArrayContains, value);
137135
}
138136

139-
Filter FilterInternal::ArrayContainsAny(
140-
const FieldPath& field, const std::vector<FieldValue>& values) {
137+
Filter FilterInternal::ArrayContainsAny(const FieldPath& field,
138+
const std::vector<FieldValue>& values) {
141139
return Where(field, kArrayContainsAny, values);
142140
}
143141

144142
Filter FilterInternal::In(const FieldPath& field,
145-
const std::vector<FieldValue>& values) {
143+
const std::vector<FieldValue>& values) {
146144
return Where(field, kIn, values);
147145
}
148146

149147
Filter FilterInternal::NotIn(const FieldPath& field,
150-
const std::vector<FieldValue>& values) {
148+
const std::vector<FieldValue>& values) {
151149
return Where(field, kNotIn, values);
152150
}
153151

@@ -166,7 +164,8 @@ Filter FilterInternal::Where(const FieldPath& field,
166164
const FieldValue& value) {
167165
Env env = GetEnv();
168166
Local<Object> java_field = FieldPathConverter::Create(env, field);
169-
Object filter = env.Call(method, java_field, FieldValueInternal::ToJava(value));
167+
Object filter =
168+
env.Call(method, java_field, FieldValueInternal::ToJava(value));
170169
return Filter(new FilterInternal(std::move(filter), false));
171170
}
172171

firestore/src/android/filter_android.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ class FilterInternal final {
5757
friend class Filter;
5858
friend class FirestoreInternal;
5959

60-
FilterInternal* clone() {
61-
return new FilterInternal(*this);
62-
}
60+
FilterInternal* clone() { return new FilterInternal(*this); }
6361

6462
bool IsEmpty() const { return is_empty_; }
6563

@@ -70,13 +68,13 @@ class FilterInternal final {
7068

7169
// A generalized function for all WhereFoo calls.
7270
static Filter Where(const FieldPath& field,
73-
const jni::StaticMethod<jni::Object>& method,
74-
const FieldValue& value);
71+
const jni::StaticMethod<jni::Object>& method,
72+
const FieldValue& value);
7573
static Filter Where(const FieldPath& field,
76-
const jni::StaticMethod<jni::Object>& method,
77-
const std::vector<FieldValue>& values);
74+
const jni::StaticMethod<jni::Object>& method,
75+
const std::vector<FieldValue>& values);
7876
static Filter Where(const jni::StaticMethod<jni::Object>& method,
79-
const std::vector<const Filter>& filters);
77+
const std::vector<const Filter>& filters);
8078
};
8179

8280
bool operator==(const FilterInternal& lhs, const FilterInternal& rhs);

firestore/src/android/query_android.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
#include "firestore/src/android/direction_android.h"
2222
#include "firestore/src/android/document_snapshot_android.h"
2323
#include "firestore/src/android/event_listener_android.h"
24-
#include "firestore/src/android/filter_android.h"
2524
#include "firestore/src/android/field_path_android.h"
2625
#include "firestore/src/android/field_value_android.h"
26+
#include "firestore/src/android/filter_android.h"
2727
#include "firestore/src/android/firestore_android.h"
2828
#include "firestore/src/android/lambda_event_listener.h"
2929
#include "firestore/src/android/listener_registration_android.h"
@@ -54,10 +54,9 @@ constexpr char kClassName[] =
5454
PROGUARD_KEEP_CLASS "com/google/firebase/firestore/Query";
5555
Method<Object> kCount("count",
5656
"()Lcom/google/firebase/firestore/AggregateQuery;");
57-
Method<Object> kWhere(
58-
"where",
59-
"(Lcom/google/firebase/firestore/Filter;)"
60-
"Lcom/google/firebase/firestore/Query;");
57+
Method<Object> kWhere("where",
58+
"(Lcom/google/firebase/firestore/Filter;)"
59+
"Lcom/google/firebase/firestore/Query;");
6160
Method<Object> kEqualTo(
6261
"whereEqualTo",
6362
"(Lcom/google/firebase/firestore/FieldPath;Ljava/lang/Object;)"

0 commit comments

Comments
 (0)