mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Removal of ToArray()
This commit is contained in:
parent
9eb22da9e7
commit
9f5cf132f0
41 changed files with 184 additions and 189 deletions
|
|
@ -173,13 +173,13 @@ namespace ServerManagerTool.Common.Model
|
|||
|
||||
if (property.GetValue(this) is IIniValuesCollection collection)
|
||||
{
|
||||
var values = SplitCollectionValues(kvPropertyValue, DELIMITER);
|
||||
values = values.Where(v => !string.IsNullOrWhiteSpace(v)).ToArray();
|
||||
var values = SplitCollectionValues(kvPropertyValue, DELIMITER)
|
||||
.Where(v => !string.IsNullOrWhiteSpace(v));
|
||||
|
||||
if (attr?.ListValueWithinBrackets ?? false)
|
||||
{
|
||||
values = values.Select(v => v.Substring(1)).ToArray();
|
||||
values = values.Select(v => v.Substring(0, v.Length - 1)).ToArray();
|
||||
values = values.Select(v => v.Substring(1));
|
||||
values = values.Select(v => v.Substring(0, v.Length - 1));
|
||||
}
|
||||
collection.FromIniValues(values);
|
||||
}
|
||||
|
|
@ -266,7 +266,7 @@ namespace ServerManagerTool.Common.Model
|
|||
return result.ToString();
|
||||
}
|
||||
|
||||
protected string[] SplitCollectionValues(string valueString, char delimiter)
|
||||
protected IEnumerable<string> SplitCollectionValues(string valueString, char delimiter)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(valueString))
|
||||
return new string[0];
|
||||
|
|
@ -306,7 +306,7 @@ namespace ServerManagerTool.Common.Model
|
|||
|
||||
result.Add(tempString.Substring(startIndex));
|
||||
|
||||
return result.ToArray();
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Update(AggregateIniValue other)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue