Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3853

Show
Ignore:
Timestamp:
08/04/08 21:35:54 (4 months ago)
Author:
kris
Message:

removed a memory allocation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/text/xml/Document.d

    r3795 r3853  
    199199        ***********************************************************************/ 
    200200         
    201         final Document header (T[] encoding = "UTF-8"
     201        final Document header (T[] encoding = null
    202202        { 
    203                 root.prepend (root.create(XmlNodeType.PI,  
    204                               `xml version="1.0" encoding="`~encoding~`"`)); 
     203                if (encoding) 
     204                    encoding = `xml version="1.0" encoding="`~encoding~`"`; 
     205                else 
     206                   encoding = `xml version="1.0" encoding="UTF-8"`; 
     207 
     208                root.prepend (root.create(XmlNodeType.PI, encoding)); 
    205209                return this; 
    206210        }