fix: Eliminates List allocations in various places. (#2158)
This commit is contained in:
parent
6f64cddd0b
commit
4836bff5eb
23 changed files with 263 additions and 200 deletions
|
|
@ -850,40 +850,6 @@ public partial class Account : IAccount, IComparable<Account>
|
|||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes a list of string values from an xml element. Null values are not added to the list.
|
||||
/// </summary>
|
||||
/// <param name="node">The XmlElement from which to deserialize.</param>
|
||||
/// <returns>String list. Value will never be null.</returns>
|
||||
private static string[] LoadAccessCheck(XmlElement node)
|
||||
{
|
||||
string[] stringList;
|
||||
var accessCheck = node["accessCheck"];
|
||||
|
||||
if (accessCheck != null)
|
||||
{
|
||||
var list = new List<string>();
|
||||
|
||||
foreach (XmlElement ip in accessCheck.GetElementsByTagName("ip"))
|
||||
{
|
||||
var text = Utility.GetText(ip, null);
|
||||
|
||||
if (text != null)
|
||||
{
|
||||
list.Add(text);
|
||||
}
|
||||
}
|
||||
|
||||
stringList = list.ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
stringList = [];
|
||||
}
|
||||
|
||||
return stringList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes a list of IPAddress values from an xml element.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue