You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2020/11/24 19:13:07 UTC
[httpcomponents-client] 05/08: Simplify if/else.
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch 5.0.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
commit 7184776e8cccb9a976952317da6b6be11e5b2527
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Nov 23 11:26:22 2020 -0500
Simplify if/else.
---
.../java/org/apache/hc/client5/http/async/methods/SimpleBody.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleBody.java b/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleBody.java
index 926fef8..421baa7 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleBody.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/SimpleBody.java
@@ -84,10 +84,8 @@ public final class SimpleBody {
if (bodyAsBytes != null) {
final Charset charset = (contentType != null ? contentType : ContentType.DEFAULT_TEXT).getCharset();
return new String(bodyAsBytes, charset != null ? charset : StandardCharsets.US_ASCII);
- } else if (bodyAsText != null) {
- return bodyAsText;
} else {
- return null;
+ return bodyAsText;
}
}