Author: atsushi
Date: 2005-06-22 14:43:43 -0400 (Wed, 22 Jun 2005)
New Revision: 46380

Modified:
   trunk/mcs/class/System.XML/System.Xml/ChangeLog
   trunk/mcs/class/System.XML/System.Xml/XmlTextReader.cs
Log:
2005-06-22  Atsushi Enomoto <[EMAIL PROTECTED]>

        * XmlTextReader.cs : use StringBuilder.ToString(int,int) when it does
          not have a large chunk of data, following Ben's idea.



Modified: trunk/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/ChangeLog     2005-06-22 18:38:14 UTC 
(rev 46379)
+++ trunk/mcs/class/System.XML/System.Xml/ChangeLog     2005-06-22 18:43:43 UTC 
(rev 46380)
@@ -1,5 +1,10 @@
 2005-06-22  Atsushi Enomoto <[EMAIL PROTECTED]>
 
+       * XmlTextReader.cs : use StringBuilder.ToString(int,int) when it does
+         not have a large chunk of data, following Ben's idea.
+
+2005-06-22  Atsushi Enomoto <[EMAIL PROTECTED]>
+
        * XmlTextReader.cs : use StringBuilder to store character values; that
          saves 40% memory for large chunk of xml. Patch by Gonzalo.
 

Modified: trunk/mcs/class/System.XML/System.Xml/XmlTextReader.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/XmlTextReader.cs      2005-06-22 
18:38:14 UTC (rev 46379)
+++ trunk/mcs/class/System.XML/System.Xml/XmlTextReader.cs      2005-06-22 
18:43:43 UTC (rev 46380)
@@ -776,7 +776,7 @@
                                                }
                                        }
 
-                                       valueCache = tmpBuilder.ToString ();
+                                       valueCache = tmpBuilder.ToString (0, 
tmpBuilder.Length);
                                        return valueCache;
                                }
 
@@ -1441,7 +1441,9 @@
 
                private string CreateValueString ()
                {
-                       return valueBuffer.ToString ();
+                       return (valueBuffer.Capacity < 100) ?
+                               valueBuffer.ToString (0, valueBuffer.Length) :
+                               valueBuffer.ToString ();
                }
 
                private void ClearValueBuffer ()

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to