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

Make field final and remove unnecessary unboxing in OnSubscribeRedo.RetryWithPredicate #3365

Merged
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
4 changes: 2 additions & 2 deletions src/main/java/rx/internal/operators/OnSubscribeRedo.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public Notification<?> call(Notification<?> terminalNotification) {
}

public static final class RetryWithPredicate implements Func1<Observable<? extends Notification<?>>, Observable<? extends Notification<?>>> {
private Func2<Integer, Throwable, Boolean> predicate;
private final Func2<Integer, Throwable, Boolean> predicate;

public RetryWithPredicate(Func2<Integer, Throwable, Boolean> predicate) {
this.predicate = predicate;
Expand All @@ -111,7 +111,7 @@ public Observable<? extends Notification<?>> call(Observable<? extends Notificat
@Override
public Notification<Integer> call(Notification<Integer> n, Notification<?> term) {
final int value = n.getValue();
if (predicate.call(value, term.getThrowable()).booleanValue())
if (predicate.call(value, term.getThrowable()))
return Notification.createOnNext(value + 1);
else
return (Notification<Integer>) term;
Expand Down