Skip to content

Commit

Permalink
Minor simplification in packet decoding
Browse files Browse the repository at this point in the history
No need to divide two equal values; just increment the block count.
  • Loading branch information
tomaswolf committed Jun 4, 2024
1 parent 249528a commit 0c2403f
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1589,9 +1589,7 @@ protected void decode() throws Exception {
} else if ((inCipher != null) && (!etmMode)) {
// Decrypt the first bytes so we can extract the packet length
inCipher.update(decoderBuffer.array(), 0, inCipherSize);

int blocksCount = inCipherSize / inCipher.getCipherBlockSize();
inBlocksCount.addAndGet(Math.max(1, blocksCount));
inBlocksCount.incrementAndGet();
}
// Read packet length
decoderLength = decoderBuffer.getInt();
Expand Down

0 comments on commit 0c2403f

Please sign in to comment.