MergerBiFunction.smali
5.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
.class public final Lio/reactivex/internal/util/MergerBiFunction;
.super Ljava/lang/Object;
.source "MergerBiFunction.java"
# interfaces
.implements Lio/reactivex/functions/BiFunction;
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;",
"Lio/reactivex/functions/BiFunction<",
"Ljava/util/List<",
"TT;>;",
"Ljava/util/List<",
"TT;>;",
"Ljava/util/List<",
"TT;>;>;"
}
.end annotation
# instance fields
.field final comparator:Ljava/util/Comparator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Comparator<",
"-TT;>;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>(Ljava/util/Comparator;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Comparator<",
"-TT;>;)V"
}
.end annotation
.line 28
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 29
iput-object p1, p0, Lio/reactivex/internal/util/MergerBiFunction;->comparator:Ljava/util/Comparator;
return-void
.end method
# virtual methods
.method public bridge synthetic apply(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.locals 0
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Exception;
}
.end annotation
.line 24
check-cast p1, Ljava/util/List;
check-cast p2, Ljava/util/List;
invoke-virtual {p0, p1, p2}, Lio/reactivex/internal/util/MergerBiFunction;->apply(Ljava/util/List;Ljava/util/List;)Ljava/util/List;
move-result-object p1
return-object p1
.end method
.method public apply(Ljava/util/List;Ljava/util/List;)Ljava/util/List;
.locals 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"TT;>;",
"Ljava/util/List<",
"TT;>;)",
"Ljava/util/List<",
"TT;>;"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/Exception;
}
.end annotation
.line 34
invoke-interface {p1}, Ljava/util/List;->size()I
move-result v0
invoke-interface {p2}, Ljava/util/List;->size()I
move-result v1
add-int/2addr v0, v1
if-nez v0, :cond_0
.line 36
new-instance p1, Ljava/util/ArrayList;
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
return-object p1
.line 38
:cond_0
new-instance v1, Ljava/util/ArrayList;
invoke-direct {v1, v0}, Ljava/util/ArrayList;-><init>(I)V
.line 40
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p1
.line 41
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object p2
.line 43
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v0
const/4 v2, 0x0
if-eqz v0, :cond_1
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
goto :goto_0
:cond_1
move-object v0, v2
.line 44
:goto_0
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_2
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
goto :goto_1
:cond_2
move-object v3, v2
:goto_1
if-eqz v0, :cond_5
if-eqz v3, :cond_5
.line 47
iget-object v4, p0, Lio/reactivex/internal/util/MergerBiFunction;->comparator:Ljava/util/Comparator;
invoke-interface {v4, v0, v3}, Ljava/util/Comparator;->compare(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v4
if-gez v4, :cond_4
.line 48
invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 49
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_3
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
goto :goto_1
:cond_3
move-object v0, v2
goto :goto_1
.line 51
:cond_4
invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 52
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_2
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
goto :goto_1
:cond_5
if-eqz v0, :cond_6
.line 57
invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 58
:goto_2
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
move-result p2
if-eqz p2, :cond_7
.line 59
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object p2
invoke-interface {v1, p2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_2
.line 62
:cond_6
invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 63
:goto_3
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
move-result p1
if-eqz p1, :cond_7
.line 64
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object p1
invoke-interface {v1, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_3
:cond_7
return-object v1
.end method