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
|
|
@ -59,17 +59,16 @@ namespace ServerManagerTool.Common.Model
|
|||
|
||||
public virtual void FromIniValues(IEnumerable<string> iniValues)
|
||||
{
|
||||
var items = iniValues?.Select(AggregateIniValue.FromINIValue<T>).ToArray();
|
||||
var items = iniValues?.Select(AggregateIniValue.FromINIValue<T>);
|
||||
|
||||
Clear();
|
||||
AddRange(items);
|
||||
IsEnabled = (Count != 0);
|
||||
IsEnabled = (Count > 0);
|
||||
|
||||
// Add any default values which were missing
|
||||
if (_resetFunc != null)
|
||||
{
|
||||
var defaultItemsToAdd = _resetFunc().Where(r => !this.Any(v => v.IsEquivalent(r))).ToArray();
|
||||
AddRange(defaultItemsToAdd);
|
||||
AddRange(_resetFunc().Where(r => !this.Any(v => v.IsEquivalent(r))));
|
||||
}
|
||||
|
||||
Sort(AggregateIniValue.SortKeySelector);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue