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 504879bdfd7a7bcee9771944f36afc4b03054bd0 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Wed Nov 30 10:01:23 2022 -0500 Lookup key in map only once --- .../compress/harmony/unpack200/SegmentConstantPoolArrayCache.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/SegmentConstantPoolArrayCache.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/SegmentConstantPoolArrayCache.java index 486e35d2..fb5d3cd1 100644 --- a/src/main/java/org/apache/commons/compress/harmony/unpack200/SegmentConstantPoolArrayCache.java +++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/SegmentConstantPoolArrayCache.java @@ -78,14 +78,8 @@ public class SegmentConstantPoolArrayCache { * @return boolean true if up-to-date cache, otherwise false. */ protected boolean arrayIsCached(final String[] array) { - if (!knownArrays.containsKey(array)) { - return false; - } final CachedArray cachedArray = knownArrays.get(array); - if (cachedArray.lastKnownSize() != array.length) { - return false; - } - return true; + return !(cachedArray == null || cachedArray.lastKnownSize() != array.length); } /**