commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject commons-compress git commit: reduce code duplication with patch by Thomas Meyer
Date Sun, 27 Mar 2016 16:37:55 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master bee261259 -> 21d1f01f6


reduce code duplication with patch by Thomas Meyer

the patch was part of a patch attached to COMPRESS-207


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

Branch: refs/heads/master
Commit: 21d1f01f681d78ab6b710f7fce84e2238a63439c
Parents: bee2612
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sun Mar 27 18:37:09 2016 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sun Mar 27 18:37:09 2016 +0200

----------------------------------------------------------------------
 .../bzip2/BZip2CompressorInputStream.java         | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/21d1f01f/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
index 4456860..edf90cb 100644
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
@@ -392,23 +392,7 @@ public class BZip2CompressorInputStream extends CompressorInputStream
implements
     }
 
     private boolean bsGetBit() throws IOException {
-        int bsLiveShadow = this.bsLive;
-        int bsBuffShadow = this.bsBuff;
-
-        if (bsLiveShadow < 1) {
-            int thech = this.in.read();
-
-            if (thech < 0) {
-                throw new IOException("unexpected end of stream");
-            }
-
-            bsBuffShadow = (bsBuffShadow << 8) | thech;
-            bsLiveShadow += 8;
-            this.bsBuff = bsBuffShadow;
-        }
-
-        this.bsLive = bsLiveShadow - 1;
-        return ((bsBuffShadow >> (bsLiveShadow - 1)) & 1) != 0;
+        return bsR(1) != 0;
     }
 
     private char bsGetUByte() throws IOException {


Mime
View raw message