fix: Eliminates List allocations in various places. (#2158)

This commit is contained in:
Kamron Batman 2025-11-16 18:33:53 -08:00 committed by GitHub
parent 6f64cddd0b
commit 4836bff5eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 263 additions and 200 deletions

View file

@ -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>