You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2018/05/24 13:04:39 UTC
commons-compress git commit: COMPRESS-453 replace while loop with
Arrays.fill
Repository: commons-compress
Updated Branches:
refs/heads/COMPRESS-453 54e90aa4d -> 6bd79a285
COMPRESS-453 replace while loop with Arrays.fill
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/6bd79a28
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/6bd79a28
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/6bd79a28
Branch: refs/heads/COMPRESS-453
Commit: 6bd79a285e89c6a4b1e0e2e869e2ee23dddda0f2
Parents: 54e90aa
Author: Stefan Bodewig <bo...@apache.org>
Authored: Thu May 24 15:04:14 2018 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Thu May 24 15:04:14 2018 +0200
----------------------------------------------------------------------
.../compress/compressors/bzip2/BZip2CompressorInputStream.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/6bd79a28/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 6971a44..af00292 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
@@ -661,9 +661,9 @@ public class BZip2CompressorInputStream extends CompressorInputStream
unzftab[ch & 0xff] += s + 1;
System.err.println("before loop s: " + s + ", lastShadow: " + lastShadow);
- while (s-- >= 0) {
- ll8[++lastShadow] = ch;
- }
+ final int from = ++lastShadow;
+ lastShadow += s;
+ Arrays.fill(ll8, from, lastShadow + 1, ch);
System.err.println("after loop s: " + s + ", lastShadow: " + lastShadow);
if (lastShadow >= limitLast) {