Simplify if/else.

This commit is contained in:
Gary Gregory 2020-11-23 11:26:22 -05:00 committed by Gary Gregory
parent 400771a1a7
commit 956b8194ff
1 changed files with 1 additions and 3 deletions

View File

@ -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;
}
}