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:
parent
bf186393db
commit
20d3ec46fd
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue