You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/08/14 12:52:25 UTC

(commons-compress) 01/09: Inline single use variable

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git

commit b66ad365e26dc1f7735230064870de794374c3ad
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Thu Aug 14 07:54:54 2025 -0400

    Inline single use variable
---
 .../java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
index 0fe7121cb..e08c54afa 100644
--- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
@@ -111,8 +111,7 @@ void assertValidity(final int maxMemoryLimitKiB) throws IOException {
             if (numberOfEntriesWithStream > numberOfUnpackSubStreams) {
                 throw new ArchiveException("Archive doesn't contain enough substreams for entries");
             }
-            final long memoryNeededKiB = bytesToKiB(estimateSizeBytes());
-            MemoryLimitException.checkKiB(memoryNeededKiB, maxMemoryLimitKiB);
+            MemoryLimitException.checkKiB(bytesToKiB(estimateSizeBytes()), maxMemoryLimitKiB);
         }
 
         private long bindPairSize() {