poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1752788 - /poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java
Date Fri, 15 Jul 2016 07:41:26 GMT
Author: onealj
Date: Fri Jul 15 07:41:26 2016
New Revision: 1752788

URL: http://svn.apache.org/viewvc?rev=1752788&view=rev
Log:
replace for-loop over index with for-each loop

Modified:
    poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java?rev=1752788&r1=1752787&r2=1752788&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/functions/TextFunction.java Fri Jul 15 07:41:26
2016
@@ -157,8 +157,7 @@ public abstract class TextFunction imple
     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 imple
          * @return  whether the character is printable
          */
         private boolean isPrintable(char c){
-			return (int) c >= 32;
+			return c >= 32;
         }
     };
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message