diff --git a/src/Shared/HandyControl_Shared/Tools/Queue/Deque!1.cs b/src/Shared/HandyControl_Shared/Tools/Queue/Deque!1.cs index d15c992c..af1aaf1f 100644 --- a/src/Shared/HandyControl_Shared/Tools/Queue/Deque!1.cs +++ b/src/Shared/HandyControl_Shared/Tools/Queue/Deque!1.cs @@ -66,18 +66,9 @@ namespace HandyControl.Tools public Deque(IEnumerable backCollection, IEnumerable frontCollection) { if (backCollection == null && frontCollection == null) throw new ArgumentException("Collections cannot both be null"); - _front = new List(); - _back = new List(); - if (backCollection != null) - { - foreach (var item in backCollection) _back.Add(item); - } - - if (frontCollection != null) - { - foreach (var item in frontCollection) _front.Add(item); - } + _front = frontCollection != null ? new List(frontCollection) : new List(); + _back = backCollection != null ? new List(backCollection) : new List(); } public void AddFirst(T item)