Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary conditional statements. #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public class HttpRequest {
private static String getValidCharset(final String charset) {
if (charset != null && charset.length() > 0)
return charset;
else

return CHARSET_UTF8;
}

Expand Down Expand Up @@ -649,7 +649,8 @@ public static byte[] encodeBytesToBytes(byte[] source, int off, int len) {
byte[] finalOut = new byte[e];
System.arraycopy(outBuff, 0, finalOut, 0, e);
return finalOut;
} else
}

return outBuff;
}
}
Expand Down Expand Up @@ -1744,7 +1745,7 @@ protected ByteArrayOutputStream byteStream() {
final int size = contentLength();
if (size > 0)
return new ByteArrayOutputStream(size);
else

return new ByteArrayOutputStream();
}

Expand Down Expand Up @@ -2194,7 +2195,7 @@ public String[] headers(final String name) {
final List<String> values = headers.get(name);
if (values != null && !values.isEmpty())
return values.toArray(new String[values.size()]);
else

return EMPTY_STRINGS;
}

Expand Down Expand Up @@ -2538,7 +2539,8 @@ public HttpRequest contentType(final String contentType, final String charset) {
if (charset != null && charset.length() > 0) {
final String separator = "; " + PARAM_CHARSET + '=';
return header(HEADER_CONTENT_TYPE, contentType + separator + charset);
} else
}

return header(HEADER_CONTENT_TYPE, contentType);
}

Expand Down