Statement unnecessarily nested within else clause.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1728604 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2016-02-05 04:59:28 +00:00
parent 2b573561f8
commit cd4fc8f885
1 changed files with 6 additions and 8 deletions

View File

@ -68,9 +68,8 @@ public class ByteArrayBuilder {
buffer.flip(); buffer.flip();
newBuffer.put(buffer); newBuffer.put(buffer);
return newBuffer; return newBuffer;
} else {
return buffer;
} }
return buffer;
} }
static ByteBuffer encode( static ByteBuffer encode(
@ -186,13 +185,12 @@ public class ByteArrayBuilder {
public byte[] toByteArray() { public byte[] toByteArray() {
if (this.buffer == null) { if (this.buffer == null) {
return new byte[] {}; return new byte[] {};
} else {
this.buffer.flip();
final byte[] b = new byte[this.buffer.remaining()];
this.buffer.get(b);
this.buffer.clear();
return b;
} }
this.buffer.flip();
final byte[] b = new byte[this.buffer.remaining()];
this.buffer.get(b);
this.buffer.clear();
return b;
} }
public void reset() { public void reset() {