From 3247a4160e9ba6e5e788b4bcd6db3a40c4e24bdf Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 6 Aug 2022 20:51:57 +0000 Subject: [github-364] use Math.min/max. Thanks to Arturo Bernal. This closes #364 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903256 13f79535-47bb-0310-9956-ffa450edef68 --- poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SLWTListing.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'poi-scratchpad/src/main') diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SLWTListing.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SLWTListing.java index c3cdac64a8..01265de7ca 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SLWTListing.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SLWTListing.java @@ -76,8 +76,7 @@ public final class SLWTListing { } // Report the first 5 children, to give a flavour - int upTo = 5; - if(children.length < 5) { upTo = children.length; } + int upTo = Math.min(children.length, 5); for(int k=0; k