commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject commons-compress git commit: No need to nest in an else block.
Date Tue, 02 May 2017 07:01:25 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master badc9868c -> 9a92b8526


No need to nest in an else block.

Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/9a92b852
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/9a92b852
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/9a92b852

Branch: refs/heads/master
Commit: 9a92b8526cd13e092b5185a59c7ff0f68a1ad56e
Parents: badc986
Author: Gary Gregory <garydgregory@gmail.com>
Authored: Tue May 2 00:01:22 2017 -0700
Committer: Gary Gregory <garydgregory@gmail.com>
Committed: Tue May 2 00:01:22 2017 -0700

----------------------------------------------------------------------
 .../commons/compress/utils/BitInputStream.java     | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/9a92b852/src/main/java/org/apache/commons/compress/utils/BitInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/utils/BitInputStream.java b/src/main/java/org/apache/commons/compress/utils/BitInputStream.java
index e53a381..d0e10ba 100644
--- a/src/main/java/org/apache/commons/compress/utils/BitInputStream.java
+++ b/src/main/java/org/apache/commons/compress/utils/BitInputStream.java
@@ -88,17 +88,16 @@ public class BitInputStream implements Closeable {
 
         if (bitsCachedSize < count) {
             return processBitsGreater57(count);
+        }
+        final long bitsOut;
+        if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
+            bitsOut = (bitsCached & MASKS[count]);
+            bitsCached >>>= count;
         } else {
-            final long bitsOut;
-            if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
-                bitsOut = (bitsCached & MASKS[count]);
-                bitsCached >>>= count;
-            } else {
-                bitsOut = (bitsCached >> (bitsCachedSize - count)) & MASKS[count];
-            }
-            bitsCachedSize -= count;
-            return bitsOut;
+            bitsOut = (bitsCached >> (bitsCachedSize - count)) & MASKS[count];
         }
+        bitsCachedSize -= count;
+        return bitsOut;
     }
 
     private long processBitsGreater57(final int count) throws IOException {


Mime
View raw message