Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EF580200C14 for ; Tue, 7 Feb 2017 21:08:29 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EDFD7160B3E; Tue, 7 Feb 2017 20:08:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 45784160B32 for ; Tue, 7 Feb 2017 21:08:29 +0100 (CET) Received: (qmail 63672 invoked by uid 500); 7 Feb 2017 20:08:28 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 63661 invoked by uid 99); 7 Feb 2017 20:08:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2017 20:08:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 50456DFBE6; Tue, 7 Feb 2017 20:08:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bodewig@apache.org To: commits@commons.apache.org Message-Id: <14eedc6926394843b86f4891251e002d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: commons-compress git commit: COMPRESS-271 avoid unnecessary calculation of hash Date: Tue, 7 Feb 2017 20:08:28 +0000 (UTC) archived-at: Tue, 07 Feb 2017 20:08:30 -0000 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 Authored: Tue Feb 7 21:06:51 2017 +0100 Committer: Stefan Bodewig 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) {