aboutsummaryrefslogtreecommitdiffstats
path: root/poi-scratchpad
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2022-08-06 20:51:57 +0000
committerPJ Fanning <fanningpj@apache.org>2022-08-06 20:51:57 +0000
commit3247a4160e9ba6e5e788b4bcd6db3a40c4e24bdf (patch)
treea94e8f9820d5be230ca26883a9efdaa57f6a2ba8 /poi-scratchpad
parent554f7298707cd5f2ae0aef8a4c9e215bcd3616ff (diff)
downloadpoi-3247a4160e9ba6e5e788b4bcd6db3a40c4e24bdf.tar.gz
poi-3247a4160e9ba6e5e788b4bcd6db3a40c4e24bdf.zip
[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
Diffstat (limited to 'poi-scratchpad')
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SLWTListing.java3
1 files changed, 1 insertions, 2 deletions
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<upTo; k++) {
Record r = children[k];
int typeID = (int)r.getRecordType();