Skip to content

Commit

Permalink
Get rid of internal 'extra' context key
Browse files Browse the repository at this point in the history
  • Loading branch information
flanglet committed Dec 26, 2023
1 parent 0c907ef commit b3483ef
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion java/src/main/java/kanzi/app/BlockCompressor.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ public Integer call()
ctx.put("pool", this.pool);
ctx.put("entropy", this.codec);
ctx.put("transform", this.transform);
ctx.put("extra", "TPAQX".equals(this.codec));

// Run the task(s)
if (nbFiles == 1)
Expand Down
1 change: 0 additions & 1 deletion java/src/main/java/kanzi/io/CompressedInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ protected void readHeader() throws IOException
{
this.entropyType = (int) this.ibs.readBits(5);
this.ctx.put("entropy", EntropyCodecFactory.getName(this.entropyType));
this.ctx.put("extra", this.entropyType == EntropyCodecFactory.TPAQX_TYPE);
}
catch (IllegalArgumentException e)
{
Expand Down
4 changes: 2 additions & 2 deletions java/src/main/java/kanzi/transform/TextCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ public TextCodec1(Map<String, Object> ctx)
if (blockSize >= 8)
log = Math.max(Math.min(Global.log2(blockSize/8), 26), 13);

boolean extraPerf = (Boolean) ctx.getOrDefault("extra", false);
boolean extraPerf = "TPAQX".equals(ctx.getOrDefault("entropy", ""));
log += (extraPerf == true) ? 1 : 0;
}

Expand Down Expand Up @@ -1072,7 +1072,7 @@ public TextCodec2(Map<String, Object> ctx)
if (blockSize >= 32)
log = Math.max(Math.min(Global.log2(blockSize/32), 24), 13);

boolean extraPerf = (Boolean) ctx.getOrDefault("extra", false);
boolean extraPerf = "TPAQX".equals(ctx.getOrDefault("entropy", ""));
log += (extraPerf == true) ? 1 : 0;
}

Expand Down

0 comments on commit b3483ef

Please sign in to comment.