hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1728604 - /httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/auth/util/ByteArrayBuilder.java
Date Fri, 05 Feb 2016 04:59:29 GMT
Author: ggregory
Date: Fri Feb  5 04:59:28 2016
New Revision: 1728604

URL: http://svn.apache.org/viewvc?rev=1728604&view=rev
Log:
Statement unnecessarily nested within else clause.

Modified:
    httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/auth/util/ByteArrayBuilder.java

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/auth/util/ByteArrayBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/auth/util/ByteArrayBuilder.java?rev=1728604&r1=1728603&r2=1728604&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/auth/util/ByteArrayBuilder.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/auth/util/ByteArrayBuilder.java
Fri Feb  5 04:59:28 2016
@@ -68,9 +68,8 @@ public class ByteArrayBuilder {
             buffer.flip();
             newBuffer.put(buffer);
             return newBuffer;
-        } else {
-            return buffer;
         }
+        return buffer;
     }
 
     static ByteBuffer encode(
@@ -186,13 +185,12 @@ public class ByteArrayBuilder {
     public byte[] toByteArray() {
         if (this.buffer == null) {
             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() {



Mime
View raw message