dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] pnetlib/System.Xml/Private XmlFragmentTextWrite...


From: Heiko Weiss
Subject: [dotgnu-pnet-commits] pnetlib/System.Xml/Private XmlFragmentTextWrite...
Date: Tue, 17 Oct 2006 13:22:53 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    pnetlib
Changes by:     Heiko Weiss <brubbel>   06/10/17 13:22:52

Modified files:
        System.Xml/Private: XmlFragmentTextWriter.cs 

Log message:
        using StringBuilder instead of adding many strings.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnetlib/System.Xml/Private/XmlFragmentTextWriter.cs?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4

Patches:
Index: XmlFragmentTextWriter.cs
===================================================================
RCS file: 
/sources/dotgnu-pnet/pnetlib/System.Xml/Private/XmlFragmentTextWriter.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- XmlFragmentTextWriter.cs    17 Oct 2006 11:44:13 -0000      1.3
+++ XmlFragmentTextWriter.cs    17 Oct 2006 13:22:52 -0000      1.4
@@ -121,16 +121,20 @@
                                }
 
                                // write the start of the document
-                               string start = "<?xml version=\"1.0\"";
+                               StringBuilder start = new StringBuilder( "<?xml 
version=\"1.0\"" );
                                if( haveEncoding ) {
-                                       start += " encoding=\"" + encoding + 
"\"";
+                                       start.Append( " encoding=\"" );
+                                       start.Append( encoding );
+                                       start.Append( "\"" );
                                }
                                if( haveStandalone ) {
-                                       start += " standalone=\"" + standalone;
+                                       start.Append( " standalone=\"" );
+                                       start.Append( standalone );
+                                       start.Append( "\"" );
                                }
-                               start += "?>";
+                               start.Append( "?>" );
                                
-                               writer.Write( start );
+                               writer.Write( start.ToString() );
                                writeState = System.Xml.WriteState.Prolog;
                        }
        




reply via email to

[Prev in Thread] Current Thread [Next in Thread]