harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r542432 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java
Date Tue, 29 May 2007 06:55:30 GMT
Author: pyang
Date: Mon May 28 23:55:29 2007
New Revision: 542432

URL: http://svn.apache.org/viewvc?view=rev&rev=542432
Log:
Apply patch for HARMONY-3842([classlib][io][perf] CharArrayWriter.write(int) method works
slowly)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java?view=diff&rev=542432&r1=542431&r2=542432
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java
Mon May 28 23:55:29 2007
@@ -79,7 +79,8 @@
             return;
         }
 
-        char[] newbuf = new char[buf.length + (2 * i)];
+        int newLen = Math.max(2 * buf.length, count + i);
+        char[] newbuf = new char[newLen];
         System.arraycopy(buf, 0, newbuf, 0, count);
         buf = newbuf;
     }



Mime
View raw message