poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1516969 - /poi/trunk/src/java/org/apache/poi/ss/util/CellReference.java
Date Fri, 23 Aug 2013 18:30:01 GMT
Author: nick
Date: Fri Aug 23 18:30:01 2013
New Revision: 1516969

URL: http://svn.apache.org/r1516969
Log:
Inspired by github pull-6, use a StringBuilder for quicker string appending

Modified:
    poi/trunk/src/java/org/apache/poi/ss/util/CellReference.java

Modified: poi/trunk/src/java/org/apache/poi/ss/util/CellReference.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/util/CellReference.java?rev=1516969&r1=1516968&r2=1516969&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/util/CellReference.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/util/CellReference.java Fri Aug 23 18:30:01 2013
@@ -420,7 +420,7 @@ public class CellReference {
 		//  treat it as the 0th one
 		int excelColNum = col + 1;
 
-		String colRef = "";
+		StringBuilder colRef = new StringBuilder(2);
 		int colRemain = excelColNum;
 
 		while(colRemain > 0) {
@@ -430,10 +430,10 @@ public class CellReference {
 
 			// The letter A is at 65
 			char colChar = (char)(thisPart+64);
-			colRef = colChar + colRef;
+			colRef.append(colChar);
 		}
 
-		return colRef;
+		return colRef.toString();
 	}
 
 	/**



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


Mime
View raw message