Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/21/10 18:46:04 (14 years ago)
Author:
epitzer
Message:

Estimate or calculate StringBuffer sizes in advance, use iterator over string splits instead of arrays. (#1138)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Default/Xml/EasyXmlGenerator.cs

    r3935 r3937  
    4949    /// <returns>The token in serialized form.</returns>
    5050    protected override string Format(BeginToken beginToken) {
    51       var dict = new Dictionary<string, object> {
     51      var dict = new Dictionary<string, string> {
    5252          {"name", beginToken.Name},
    53           {"id", beginToken.Id}};
    54       return CreateNodeStart(typeCache[beginToken.TypeId], dict);       
     53          {"id", beginToken.Id.ToString()}};
     54      return CreateNodeStart(typeCache[beginToken.TypeId], dict);
    5555    }
    5656
     
    7070    /// <returns>The token in serialized form.</returns>
    7171    protected override string Format(PrimitiveToken dataToken) {
    72       var dict = new Dictionary<string, object> {
     72      var dict = new Dictionary<string, string> {
    7373            {"name", dataToken.Name},
    74             {"id", dataToken.Id}};
     74            {"id", dataToken.Id.ToString()}};
    7575      return CreateNode(typeCache[dataToken.TypeId], dict,
    7676        ((XmlString)dataToken.SerialData).Data);
     
    8484    protected override string Format(ReferenceToken refToken) {
    8585      return CreateNode(refToken.Id.ToString(),
    86         new Dictionary<string, object> {
     86        new Dictionary<string, string> {
    8787          {"name", refToken.Name}});
    8888    }
     
    9595    protected override string Format(NullReferenceToken nullRefToken) {
    9696      return CreateNode(XmlStringConstants.NULL,
    97         new Dictionary<string, object>{
     97        new Dictionary<string, string>{
    9898          {"name", nullRefToken.Name}});
    9999    }
Note: See TracChangeset for help on using the changeset viewer.