]> source.dussan.org Git - poi.git/commitdiff
replace for-loop over index with for-each loop
authorJaven O'Neal <onealj@apache.org>
Fri, 15 Jul 2016 07:41:26 +0000 (07:41 +0000)
committerJaven O'Neal <onealj@apache.org>
Fri, 15 Jul 2016 07:41:26 +0000 (07:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1752788 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ss/formula/functions/TextFunction.java

index f9562ef857a93c44e7e4bf42367f65e0820b7a0a..c8b4b3ca0f6b3fb07011cb450c836990ebf52f5f 100644 (file)
@@ -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;
         }
     };