This commit is contained in:
NaBian committed 2020-07-11 22:17:22 +08:00
commit 431758ebb4
1 file changed
+2 -11
@@ -66,18 +66,9 @@ namespace HandyControl.Tools
public Deque(IEnumerable<T> backCollection, IEnumerable<T> frontCollection)
{
if (backCollection == null && frontCollection == null) throw new ArgumentException("Collections cannot both be null");
_front = new List<T>();
_back = new List<T>();
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<T>(frontCollection) : new List<T>();
_back = backCollection != null ? new List<T>(backCollection) : new List<T>();
}
public void AddFirst(T item)