Skip to content

Commit

Permalink
Simplify to Option.apply
Browse files Browse the repository at this point in the history
  • Loading branch information
Akirathan committed Feb 29, 2024
1 parent 0212393 commit c105401
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void onNext(List<ByteBuffer> items) {
for (ByteBuffer item : items) {
var len = item.remaining();
downloaded += len;
progress.reportProgress(downloaded, total == null ? Option.empty() : Some.apply(total));
progress.reportProgress(downloaded, Option.apply(total));
destChannel.write(item);
}
subscription.request(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void onNext(List<ByteBuffer> items) {
for (ByteBuffer item : items) {
var len = item.remaining();
downloaded += len;
progress.reportProgress(downloaded, total == null ? Option.empty() : Some.apply(total));
progress.reportProgress(downloaded, Option.apply(total));
byte[] bytes = new byte[len];
item.get(bytes);
destination.write(bytes, 0, bytes.length);
Expand Down

0 comments on commit c105401

Please sign in to comment.