Skip to content

Commit

Permalink
Apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Jan 15, 2024
1 parent 9607fbd commit 015c221
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ Mono<T> before(Flux<T> flux) {

@AfterTemplate
Mono<T> after(Flux<T> flux) {
return flux.transform(MathFlux::min).next();
return flux.transform(MathFlux::min).singleOrEmpty();
}
}

Expand All @@ -1629,7 +1629,7 @@ Mono<T> before(Flux<T> flux, Comparator<? super T> cmp) {

@AfterTemplate
Mono<T> after(Flux<T> flux, Comparator<? super T> cmp) {
return flux.transform(f -> MathFlux.min(f, cmp)).next();
return flux.transform(f -> MathFlux.min(f, cmp)).singleOrEmpty();
}
}

Expand All @@ -1642,7 +1642,7 @@ Mono<T> before(Flux<T> flux) {

@AfterTemplate
Mono<T> after(Flux<T> flux) {
return flux.transform(MathFlux::max).next();
return flux.transform(MathFlux::max).singleOrEmpty();
}
}

Expand All @@ -1659,7 +1659,7 @@ Mono<T> before(Flux<T> flux, Comparator<? super T> cmp) {

@AfterTemplate
Mono<T> after(Flux<T> flux, Comparator<? super T> cmp) {
return flux.transform(f -> MathFlux.max(f, cmp)).next();
return flux.transform(f -> MathFlux.max(f, cmp)).singleOrEmpty();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,23 +530,23 @@ Flux<Integer> testFluxSort() {
}

Mono<Integer> testFluxTransformMin() {
return Flux.just(1).transform(MathFlux::min).next();
return Flux.just(1).transform(MathFlux::min).singleOrEmpty();
}

ImmutableSet<Mono<Integer>> testFluxTransformMinWithComparator() {
return ImmutableSet.of(
Flux.just(1).transform(f -> MathFlux.min(f, reverseOrder())).next(),
Flux.just(2).transform(f -> MathFlux.min(f, reverseOrder())).next());
Flux.just(1).transform(f -> MathFlux.min(f, reverseOrder())).singleOrEmpty(),
Flux.just(2).transform(f -> MathFlux.min(f, reverseOrder())).singleOrEmpty());
}

Mono<Integer> testFluxTransformMax() {
return Flux.just(1).transform(MathFlux::max).next();
return Flux.just(1).transform(MathFlux::max).singleOrEmpty();
}

ImmutableSet<Mono<Integer>> testFluxTransformMaxWithComparator() {
return ImmutableSet.of(
Flux.just(1).transform(f -> MathFlux.max(f, reverseOrder())).next(),
Flux.just(2).transform(f -> MathFlux.max(f, reverseOrder())).next());
Flux.just(1).transform(f -> MathFlux.max(f, reverseOrder())).singleOrEmpty(),
Flux.just(2).transform(f -> MathFlux.max(f, reverseOrder())).singleOrEmpty());
}

ImmutableSet<Mono<Integer>> testMathFluxMin() {
Expand Down

0 comments on commit 015c221

Please sign in to comment.