allocate extra space when expanding CharBuffer: SANDBOX-189

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/sandbox/csv/trunk@522920 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2007-03-27 14:16:09 +00:00
parent bf186393db
commit 20d3ec46fd
1 changed files with 1 additions and 1 deletions

View File

@ -183,7 +183,7 @@ public class CharBuffer {
*/
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;