commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r522920 - /jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java
Date Tue, 27 Mar 2007 14:16:10 GMT
Author: yonik
Date: Tue Mar 27 07:16:09 2007
New Revision: 522920

URL: http://svn.apache.org/viewvc?view=rev&rev=522920
Log:
allocate extra space when expanding CharBuffer: SANDBOX-189

Modified:
    jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java

Modified: jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java?view=diff&rev=522920&r1=522919&r2=522920
==============================================================================
--- jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java (original)
+++ jakarta/commons/sandbox/csv/trunk/src/java/org/apache/commons/csv/CharBuffer.java Tue
Mar 27 07:16:09 2007
@@ -183,7 +183,7 @@
      */
     public void provideCapacity(final int capacity) {
         if (c.length >= capacity) return;
-        int newcapacity = capacity;
+        int newcapacity = ((capacity*3)>>1) + 1;
         char[] newc = new char[newcapacity];
         System.arraycopy(c, 0, newc, 0, length);
         c = newc;



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message