FlowableFromIterable$IteratorSubscription.smali

.class final Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;
.super Lio/reactivex/internal/operators/flowable/FlowableFromIterable$BaseRangeSubscription;
.source "FlowableFromIterable.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lio/reactivex/internal/operators/flowable/FlowableFromIterable;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = "IteratorSubscription"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lio/reactivex/internal/operators/flowable/FlowableFromIterable$BaseRangeSubscription<",
        "TT;>;"
    }
.end annotation


# static fields
.field private static final serialVersionUID:J = -0x53954cbe186540ffL


# instance fields
.field final actual:Lorg/reactivestreams/Subscriber;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lorg/reactivestreams/Subscriber<",
            "-TT;>;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .registers 1

    return-void
.end method

.method constructor <init>(Lorg/reactivestreams/Subscriber;Ljava/util/Iterator;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/reactivestreams/Subscriber<",
            "-TT;>;",
            "Ljava/util/Iterator<",
            "+TT;>;)V"
        }
    .end annotation

    .line 150
    .local p0, "this":Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;, "Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription<TT;>;"
    .local p1, "actual":Lorg/reactivestreams/Subscriber;, "Lorg/reactivestreams/Subscriber<-TT;>;"
    .local p2, "it":Ljava/util/Iterator;, "Ljava/util/Iterator<+TT;>;"
    invoke-direct {p0, p2}, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$BaseRangeSubscription;-><init>(Ljava/util/Iterator;)V

    .line 151
    iput-object p1, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->actual:Lorg/reactivestreams/Subscriber;

    .line 152
    return-void
.end method


# virtual methods
.method fastPath()V
    .registers 6

    .line 156
    .local p0, "this":Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;, "Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription<TT;>;"
    iget-object v0, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->it:Ljava/util/Iterator;

    .line 157
    .local v0, "it":Ljava/util/Iterator;, "Ljava/util/Iterator<+TT;>;"
    iget-object v1, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->actual:Lorg/reactivestreams/Subscriber;

    .line 159
    .local v1, "a":Lorg/reactivestreams/Subscriber;, "Lorg/reactivestreams/Subscriber<-TT;>;"
    :goto_4
    iget-boolean v2, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->cancelled:Z

    if-eqz v2, :cond_9

    .line 160
    return-void

    .line 166
    :cond_9
    :try_start_9
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2
    :try_end_d
    .catchall {:try_start_9 .. :try_end_d} :catchall_40

    .line 171
    .local v2, "t":Ljava/lang/Object;, "TT;"
    nop

    .line 173
    iget-boolean v3, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->cancelled:Z

    if-eqz v3, :cond_13

    .line 174
    return-void

    .line 177
    :cond_13
    if-nez v2, :cond_20

    .line 178
    new-instance v3, Ljava/lang/NullPointerException;

    const-string v4, "Iterator.next() returned a null value"

    invoke-direct {v3, v4}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    invoke-interface {v1, v3}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V

    .line 179
    return-void

    .line 181
    :cond_20
    invoke-interface {v1, v2}, Lorg/reactivestreams/Subscriber;->onNext(Ljava/lang/Object;)V

    .line 184
    iget-boolean v3, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->cancelled:Z

    if-eqz v3, :cond_28

    .line 185
    return-void

    .line 191
    :cond_28
    :try_start_28
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v3
    :try_end_2c
    .catchall {:try_start_28 .. :try_end_2c} :catchall_38

    .line 196
    .local v3, "b":Z
    nop

    .line 199
    if-nez v3, :cond_37

    .line 200
    iget-boolean v4, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->cancelled:Z

    if-nez v4, :cond_36

    .line 201
    invoke-interface {v1}, Lorg/reactivestreams/Subscriber;->onComplete()V

    .line 203
    :cond_36
    return-void

    .line 205
    .end local v2    # "t":Ljava/lang/Object;, "TT;"
    .end local v3    # "b":Z
    :cond_37
    goto :goto_4

    .line 192
    .restart local v2    # "t":Ljava/lang/Object;, "TT;"
    :catchall_38
    move-exception v3

    .line 193
    .local v3, "ex":Ljava/lang/Throwable;
    invoke-static {v3}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V

    .line 194
    invoke-interface {v1, v3}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V

    .line 195
    return-void

    .line 167
    .end local v2    # "t":Ljava/lang/Object;, "TT;"
    .end local v3    # "ex":Ljava/lang/Throwable;
    :catchall_40
    move-exception v2

    .line 168
    .local v2, "ex":Ljava/lang/Throwable;
    invoke-static {v2}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V

    .line 169
    invoke-interface {v1, v2}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V

    .line 170
    return-void
.end method

.method slowPath(J)V
    .registers 11
    .param p1, "r"    # J

    .line 210
    .local p0, "this":Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;, "Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription<TT;>;"
    const-wide/16 v0, 0x0

    .line 211
    .local v0, "e":J
    iget-object v2, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->it:Ljava/util/Iterator;

    .line 212
    .local v2, "it":Ljava/util/Iterator;, "Ljava/util/Iterator<+TT;>;"
    iget-object v3, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->actual:Lorg/reactivestreams/Subscriber;

    .line 216
    .local v3, "a":Lorg/reactivestreams/Subscriber;, "Lorg/reactivestreams/Subscriber<-TT;>;"
    :goto_6
    cmp-long v4, v0, p1

    if-eqz v4, :cond_51

    .line 218
    iget-boolean v4, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->cancelled:Z

    if-eqz v4, :cond_f

    .line 219
    return-void

    .line 225
    :cond_f
    :try_start_f
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4
    :try_end_13
    .catchall {:try_start_f .. :try_end_13} :catchall_49

    .line 230
    .local v4, "t":Ljava/lang/Object;, "TT;"
    nop

    .line 232
    iget-boolean v5, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->cancelled:Z

    if-eqz v5, :cond_19

    .line 233
    return-void

    .line 236
    :cond_19
    if-nez v4, :cond_26

    .line 237
    new-instance v5, Ljava/lang/NullPointerException;

    const-string v6, "Iterator.next() returned a null value"

    invoke-direct {v5, v6}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    invoke-interface {v3, v5}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V

    .line 238
    return-void

    .line 240
    :cond_26
    invoke-interface {v3, v4}, Lorg/reactivestreams/Subscriber;->onNext(Ljava/lang/Object;)V

    .line 243
    iget-boolean v5, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->cancelled:Z

    if-eqz v5, :cond_2e

    .line 244
    return-void

    .line 250
    :cond_2e
    :try_start_2e
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v5
    :try_end_32
    .catchall {:try_start_2e .. :try_end_32} :catchall_41

    .line 255
    .local v5, "b":Z
    nop

    .line 257
    if-nez v5, :cond_3d

    .line 258
    iget-boolean v6, p0, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->cancelled:Z

    if-nez v6, :cond_3c

    .line 259
    invoke-interface {v3}, Lorg/reactivestreams/Subscriber;->onComplete()V

    .line 261
    :cond_3c
    return-void

    .line 264
    :cond_3d
    const-wide/16 v6, 0x1

    add-long/2addr v0, v6

    .line 265
    .end local v4    # "t":Ljava/lang/Object;, "TT;"
    .end local v5    # "b":Z
    goto :goto_6

    .line 251
    .restart local v4    # "t":Ljava/lang/Object;, "TT;"
    :catchall_41
    move-exception v5

    .line 252
    .local v5, "ex":Ljava/lang/Throwable;
    invoke-static {v5}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V

    .line 253
    invoke-interface {v3, v5}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V

    .line 254
    return-void

    .line 226
    .end local v4    # "t":Ljava/lang/Object;, "TT;"
    .end local v5    # "ex":Ljava/lang/Throwable;
    :catchall_49
    move-exception v4

    .line 227
    .local v4, "ex":Ljava/lang/Throwable;
    invoke-static {v4}, Lio/reactivex/exceptions/Exceptions;->throwIfFatal(Ljava/lang/Throwable;)V

    .line 228
    invoke-interface {v3, v4}, Lorg/reactivestreams/Subscriber;->onError(Ljava/lang/Throwable;)V

    .line 229
    return-void

    .line 267
    .end local v4    # "ex":Ljava/lang/Throwable;
    :cond_51
    invoke-virtual {p0}, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->get()J

    move-result-wide p1

    .line 268
    cmp-long v4, v0, p1

    if-nez v4, :cond_68

    .line 269
    neg-long v4, v0

    invoke-virtual {p0, v4, v5}, Lio/reactivex/internal/operators/flowable/FlowableFromIterable$IteratorSubscription;->addAndGet(J)J

    move-result-wide p1

    .line 270
    const-wide/16 v4, 0x0

    cmp-long v6, p1, v4

    if-nez v6, :cond_65

    .line 271
    return-void

    .line 273
    :cond_65
    const-wide/16 v0, 0x0

    goto :goto_6

    .line 268
    :cond_68
    goto :goto_6
.end method