Skip to content

Commit

Permalink
Use a mode idiomatic syntax in isChunked.
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel (dB.) Doubrovkine <[email protected]>
  • Loading branch information
dblock committed Jul 13, 2022
1 parent edb7d55 commit cc0f83f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ public InputStream getContent() throws IOException {
*/
@Override
public boolean isChunked() {
return chunkedEnabled.isPresent() ? chunkedEnabled.get() : super.isChunked();
return chunkedEnabled.orElseGet(super::isChunked);
}

/**
Expand Down Expand Up @@ -1070,7 +1070,7 @@ public ContentHttpEntity(HttpEntity entity, boolean chunkedEnabled) {
*/
@Override
public boolean isChunked() {
return chunkedEnabled.isPresent() ? chunkedEnabled.get() : super.isChunked();
return chunkedEnabled.orElseGet(super::isChunked);
}
}

Expand Down

0 comments on commit cc0f83f

Please sign in to comment.