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: COMPRESS-271 avoid unnecessary calculation of hash
Date Tue, 07 Feb 2017 20:08:28 GMT
Repository: commons-compress
Updated Branches:
  refs/heads/master a5720927e -> cfd695786


COMPRESS-271 avoid unnecessary calculation of hash


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

Branch: refs/heads/master
Commit: cfd695786f2b4e0e3a2eb5241f8fcd5bc3e412e9
Parents: a572092
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Tue Feb 7 21:06:51 2017 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Tue Feb 7 21:06:51 2017 +0100

----------------------------------------------------------------------
 .../compressors/lz4/FramedLZ4CompressorOutputStream.java         | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/cfd69578/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorOutputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorOutputStream.java
b/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorOutputStream.java
index f2c0e54..3ebcaa0 100644
--- a/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/lz4/FramedLZ4CompressorOutputStream.java
@@ -170,7 +170,9 @@ public class FramedLZ4CompressorOutputStream extends CompressorOutputStream
{
 
     @Override
     public void write(byte[] data, int off, int len) throws IOException {
-        contentHash.update(data, off, len);
+        if (params.withContentChecksum) {
+            contentHash.update(data, off, len);
+        }
         if (currentIndex + len > blockData.length) {
             flushBlock();
             while (len > blockData.length) {


Mime
View raw message