Use StringBuilder instead of manually appending strings in FieldSaver
This commit is contained in:
@@ -15,6 +15,7 @@ using System.ComponentModel;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
using OpenRA.Primitives;
|
using OpenRA.Primitives;
|
||||||
|
|
||||||
namespace OpenRA
|
namespace OpenRA
|
||||||
@@ -84,7 +85,7 @@ namespace OpenRA
|
|||||||
// This is only for documentation generation
|
// This is only for documentation generation
|
||||||
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Dictionary<,>))
|
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Dictionary<,>))
|
||||||
{
|
{
|
||||||
var result = "";
|
var result = new StringBuilder();
|
||||||
var dict = (System.Collections.IDictionary)v;
|
var dict = (System.Collections.IDictionary)v;
|
||||||
foreach (var kvp in dict)
|
foreach (var kvp in dict)
|
||||||
{
|
{
|
||||||
@@ -94,10 +95,10 @@ namespace OpenRA
|
|||||||
var formattedKey = FormatValue(key);
|
var formattedKey = FormatValue(key);
|
||||||
var formattedValue = FormatValue(value);
|
var formattedValue = FormatValue(value);
|
||||||
|
|
||||||
result += $"{formattedKey}: {formattedValue}{Environment.NewLine}";
|
result.Append($"{formattedKey}: {formattedValue}{Environment.NewLine}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v is DateTime d)
|
if (v is DateTime d)
|
||||||
|
|||||||
Reference in New Issue
Block a user