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:49 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master 9a92b8526 -> 6ae55beb2


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/6ae55beb
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/6ae55beb
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/6ae55beb

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

----------------------------------------------------------------------
 .../compressors/lz4/FramedLZ4CompressorInputStream.java  | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/6ae55beb/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStream.java
b/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStream.java
index 2f1eabb..f0bb329 100644
--- a/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorInputStream.java
@@ -308,13 +308,12 @@ public class FramedLZ4CompressorInputStream extends CompressorInputStream
{
             int cnt = currentBlock.read(b, off, len);
             count(cnt);
             return cnt;
-        } else {
-            BlockLZ4CompressorInputStream l = (BlockLZ4CompressorInputStream) currentBlock;
-            long before = l.getBytesRead();
-            int cnt = currentBlock.read(b, off, len);
-            count(l.getBytesRead() - before);
-            return cnt;
         }
+        BlockLZ4CompressorInputStream l = (BlockLZ4CompressorInputStream) currentBlock;
+        long before = l.getBytesRead();
+        int cnt = currentBlock.read(b, off, len);
+        count(l.getBytesRead() - before);
+        return cnt;
     }
 
     private static boolean isSkippableFrameSignature(byte[] b) {


Mime
View raw message