You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2020/11/24 14:22:41 UTC

[httpcomponents-client] 04/06: Simplify if/else.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit 956b8194ff792d07fbcf01853f18126dcf9e8264
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;
         }
     }