Fix build after merge
This commit is contained in:
@@ -1,60 +1,39 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Collections
|
||||
namespace Umbraco.Cms.Core.Collections
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection that can be both a queue and a stack.
|
||||
/// Collection that can be both a queue and a stack.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class StackQueue<T>
|
||||
{
|
||||
private readonly LinkedList<T> _linkedList = new LinkedList<T>();
|
||||
private readonly LinkedList<T> _linkedList = new();
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_linkedList.Clear();
|
||||
}
|
||||
public int Count => _linkedList.Count;
|
||||
|
||||
public void Push(T obj)
|
||||
{
|
||||
_linkedList.AddFirst(obj);
|
||||
}
|
||||
public void Clear() => _linkedList.Clear();
|
||||
|
||||
public void Enqueue(T obj)
|
||||
{
|
||||
_linkedList.AddFirst(obj);
|
||||
}
|
||||
public void Push(T obj) => _linkedList.AddFirst(obj);
|
||||
|
||||
public void Enqueue(T obj) => _linkedList.AddFirst(obj);
|
||||
|
||||
public T Pop()
|
||||
{
|
||||
var obj = _linkedList.First.Value;
|
||||
T obj = _linkedList.First.Value;
|
||||
_linkedList.RemoveFirst();
|
||||
return obj;
|
||||
}
|
||||
|
||||
public T Dequeue()
|
||||
{
|
||||
var obj = _linkedList.Last.Value;
|
||||
T obj = _linkedList.Last.Value;
|
||||
_linkedList.RemoveLast();
|
||||
return obj;
|
||||
}
|
||||
|
||||
public T PeekStack()
|
||||
{
|
||||
return _linkedList.First.Value;
|
||||
}
|
||||
public T PeekStack() => _linkedList.First.Value;
|
||||
|
||||
public T PeekQueue()
|
||||
{
|
||||
return _linkedList.Last.Value;
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return _linkedList.Count;
|
||||
}
|
||||
}
|
||||
public T PeekQueue() => _linkedList.Last.Value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user