diff options
author | Javen O'Neal <onealj@apache.org> | 2016-07-15 07:41:26 +0000 |
---|---|---|
committer | Javen O'Neal <onealj@apache.org> | 2016-07-15 07:41:26 +0000 |
commit | f7fa4f4384a2b25af958a058f2676fbb8776af1f (patch) | |
tree | b2b7c1a916ec27272046e4fb6c6e63aabcca4228 /src/java/org/apache | |
parent | 1c0a2bd670f957b56a24114dc449c099388e5098 (diff) | |
download | poi-f7fa4f4384a2b25af958a058f2676fbb8776af1f.tar.gz poi-f7fa4f4384a2b25af958a058f2676fbb8776af1f.zip |
replace for-loop over index with for-each loop
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1752788 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/poi/ss/formula/functions/TextFunction.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/java/org/apache/poi/ss/formula/functions/TextFunction.java b/src/java/org/apache/poi/ss/formula/functions/TextFunction.java index f9562ef857..c8b4b3ca0f 100644 --- a/src/java/org/apache/poi/ss/formula/functions/TextFunction.java +++ b/src/java/org/apache/poi/ss/formula/functions/TextFunction.java @@ -157,8 +157,7 @@ public abstract class TextFunction implements Function { public static final Function CLEAN = new SingleArgTextFunc() { protected ValueEval evaluate(String arg) { StringBuilder result = new StringBuilder(); - for (int i = 0; i < arg.length(); i++) { - char c = arg.charAt(i); + for (final char c : arg.toCharArray()) { if (isPrintable(c)) { result.append(c); } @@ -178,7 +177,7 @@ public abstract class TextFunction implements Function { * @return whether the character is printable */ private boolean isPrintable(char c){ - return (int) c >= 32; + return c >= 32; } }; |