commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [1/4] commons-compress git commit: COMPRESS-271 no need to special-case EOF state
Date Tue, 17 Jan 2017 20:46:11 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master 51d03dda0 -> b8939bea3


COMPRESS-271 no need to special-case EOF state


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

Branch: refs/heads/master
Commit: 8a949d10e9913b1e25aa507169ea211bb3971ad6
Parents: 51d03dd
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Tue Jan 17 21:00:51 2017 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Tue Jan 17 21:00:51 2017 +0100

----------------------------------------------------------------------
 .../compress/compressors/lz4/BlockLZ4CompressorInputStream.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/8a949d10/src/main/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorInputStream.java
b/src/main/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorInputStream.java
index 89e74f7..bdefcb2 100644
--- a/src/main/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorInputStream.java
@@ -60,10 +60,9 @@ public class BlockLZ4CompressorInputStream extends AbstractLZ77CompressorInputSt
      */
     @Override
     public int read(final byte[] b, final int off, final int len) throws IOException {
-        if (state == State.EOF) {
-            return -1;
-        }
         switch (state) {
+        case EOF:
+            return -1;
         case NO_BLOCK:
             readSizes();
             /*FALLTHROUGH*/


Mime
View raw message