Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant methods from Sample(Observable) #6469

Merged
merged 6 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void onError(Throwable t) {
@Override
public void onComplete() {
SubscriptionHelper.cancel(other);
completeMain();
completion();
}

void setOther(Subscription o) {
Expand All @@ -117,7 +117,7 @@ public void error(Throwable e) {

public void complete() {
upstream.cancel();
completeOther();
completion();
}

void emit() {
Expand All @@ -134,9 +134,7 @@ void emit() {
}
}

abstract void completeMain();

abstract void completeOther();
abstract void completion();

abstract void run();
}
Expand Down Expand Up @@ -178,12 +176,7 @@ static final class SampleMainNoLast<T> extends SamplePublisherSubscriber<T> {
}

@Override
void completeMain() {
downstream.onComplete();
}

@Override
void completeOther() {
void completion() {
downstream.onComplete();
}

Expand All @@ -207,16 +200,7 @@ static final class SampleMainEmitLast<T> extends SamplePublisherSubscriber<T> {
}

@Override
void completeMain() {
done = true;
if (wip.getAndIncrement() == 0) {
emit();
downstream.onComplete();
}
}

@Override
void completeOther() {
void completion() {
done = true;
if (wip.getAndIncrement() == 0) {
emit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void onError(Throwable t) {
@Override
public void onComplete() {
DisposableHelper.dispose(other);
completeMain();
completion();
}

boolean setOther(Disposable o) {
Expand All @@ -109,7 +109,7 @@ public void error(Throwable e) {

public void complete() {
upstream.dispose();
completeOther();
completion();
}

void emit() {
Expand All @@ -119,9 +119,7 @@ void emit() {
}
}

abstract void completeMain();

abstract void completeOther();
abstract void completion();

abstract void run();
}
Expand Down Expand Up @@ -163,12 +161,7 @@ static final class SampleMainNoLast<T> extends SampleMainObserver<T> {
}

@Override
void completeMain() {
downstream.onComplete();
}

@Override
void completeOther() {
void completion() {
downstream.onComplete();
}

Expand All @@ -192,16 +185,7 @@ static final class SampleMainEmitLast<T> extends SampleMainObserver<T> {
}

@Override
void completeMain() {
done = true;
if (wip.getAndIncrement() == 0) {
emit();
downstream.onComplete();
}
}

@Override
void completeOther() {
void completion() {
done = true;
if (wip.getAndIncrement() == 0) {
emit();
Expand Down