commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [1/3] commons-compress git commit: cosmetics
Date Thu, 06 Apr 2017 13:18:30 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master 3381e41ab -> 5ce60be9d


cosmetics


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

Branch: refs/heads/master
Commit: 47213feb954bef78d646da4f4ffe6a8156c7d3f5
Parents: 3381e41
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Thu Apr 6 10:32:33 2017 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Thu Apr 6 10:32:33 2017 +0200

----------------------------------------------------------------------
 .../lz4/BlockLZ4CompressorOutputStream.java           | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/47213feb/src/main/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorOutputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorOutputStream.java
b/src/main/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorOutputStream.java
index d3249db..dfce36e 100644
--- a/src/main/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/lz4/BlockLZ4CompressorOutputStream.java
@@ -385,14 +385,12 @@ public class BlockLZ4CompressorOutputStream extends CompressorOutputStream
{
         }
         Pair splitCandidate = lastPairs.get(0);
         int stillNeeded = MIN_OFFSET_OF_LAST_BACK_REFERENCE - toExpand;
-        if (splitCandidate.hasBackReference()
-            && splitCandidate.backReferenceLength() >= MIN_BACK_REFERENCE_LENGTH
+ stillNeeded) {
+        int brLen = splitCandidate.hasBackReference() ? splitCandidate.backReferenceLength()
: 0;
+        if (splitCandidate.hasBackReference() && brLen >= MIN_BACK_REFERENCE_LENGTH
+ stillNeeded) {
             replacement.prependLiteral(expand(toExpand + stillNeeded, stillNeeded));
-            pairs.add(splitCandidate.splitWithNewBackReferenceLengthOf(splitCandidate.backReferenceLength()
-                - stillNeeded));
+            pairs.add(splitCandidate.splitWithNewBackReferenceLengthOf(brLen - stillNeeded));
         } else {
             if (splitCandidate.hasBackReference()) {
-                int brLen = splitCandidate.backReferenceLength();
                 replacement.prependLiteral(expand(toExpand + brLen, brLen));
             }
             splitCandidate.prependTo(replacement);
@@ -487,9 +485,9 @@ public class BlockLZ4CompressorOutputStream extends CompressorOutputStream
{
             return brLength;
         }
         private void prependTo(Pair other) {
-            Iterator<byte[]> litsBackwards = literals.descendingIterator();
-            while (litsBackwards.hasNext()) {
-                other.prependLiteral(litsBackwards.next());
+            Iterator<byte[]> listBackwards = literals.descendingIterator();
+            while (listBackwards.hasNext()) {
+                other.prependLiteral(listBackwards.next());
             }
         }
         private Pair splitWithNewBackReferenceLengthOf(int newBackReferenceLength) {


Mime
View raw message