aboutsummaryrefslogtreecommitdiffstats
path: root/poi-scratchpad/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2022-07-16 10:13:18 +0000
committerPJ Fanning <fanningpj@apache.org>2022-07-16 10:13:18 +0000
commit4f54f29a2daa62839d22804d22544e4197cfda75 (patch)
tree367341b6fac45df026ce3673a421a23567fab957 /poi-scratchpad/src
parentfeae2c87490392f2e69212949a1e734e930e7e20 (diff)
downloadpoi-4f54f29a2daa62839d22804d22544e4197cfda75.tar.gz
poi-4f54f29a2daa62839d22804d22544e4197cfda75.zip
[github-345] Use switch instead of if. Thanks to XenoAmess. This closes #345
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902772 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad/src')
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/RecordUtil.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/RecordUtil.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/RecordUtil.java
index cd11e5d879..6c401cc512 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/RecordUtil.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/dev/RecordUtil.java
@@ -107,12 +107,17 @@ public class RecordUtil
byte numBits = 0;
int mask = (int) Long.parseLong( bitMask.substring( 2 ), 16 );
- if ( parentType.equals( "byte" ) )
- parentSize = 8;
- else if ( parentType.equals( "short" ) )
- parentSize = 16;
- else if ( parentType.equals( "int" ) )
- parentSize = 32;
+ switch (parentType) {
+ case "byte":
+ parentSize = 8;
+ break;
+ case "short":
+ parentSize = 16;
+ break;
+ case "int":
+ parentSize = 32;
+ break;
+ }
for ( int x = 0; x < parentSize; x++ )
{