daily update on 20230111 by nitload youmu
This commit is contained in:
@@ -6,33 +6,33 @@ namespace StgSharp.Logic
|
||||
{
|
||||
public class LinkedList<T> where T: INode
|
||||
{
|
||||
private LinkedListNode<T> _head;
|
||||
private LinkedListNode<T> _tail;
|
||||
internal ContainerNode<T> _head;
|
||||
internal ContainerNode<T> _tail;
|
||||
|
||||
private LinkedListNode<T> _cache;
|
||||
private ContainerNode<T> _cache;
|
||||
|
||||
public T Head
|
||||
{
|
||||
get { return _head._this; }
|
||||
set { _head = new LinkedListNode<T>(value); }
|
||||
set { _head = new ContainerNode<T>(value); }
|
||||
}
|
||||
|
||||
public T Tail
|
||||
{
|
||||
get { return _tail._this; }
|
||||
set { _tail = new LinkedListNode<T>(value); }
|
||||
set { _tail = new ContainerNode<T>(value); }
|
||||
}
|
||||
|
||||
|
||||
public void Add(T t)
|
||||
{
|
||||
if (_head != default(LinkedListNode<T>))
|
||||
if (_head != default(ContainerNode<T>))
|
||||
{
|
||||
Head = t;
|
||||
}
|
||||
else
|
||||
{
|
||||
_cache = new LinkedListNode<T>(t);
|
||||
_cache = new ContainerNode<T>(t);
|
||||
_tail._next = _cache;
|
||||
_cache._previous = _tail;
|
||||
_tail = _cache;
|
||||
@@ -41,7 +41,7 @@ namespace StgSharp.Logic
|
||||
|
||||
public void RemoveTail()
|
||||
{
|
||||
if (_tail==default(LinkedListNode<T>))
|
||||
if (_tail==default(ContainerNode<T>))
|
||||
{
|
||||
|
||||
}
|
||||
@@ -49,7 +49,7 @@ namespace StgSharp.Logic
|
||||
{
|
||||
_cache = _tail;
|
||||
_tail = _cache._previous;
|
||||
_cache._previous = default(LinkedListNode<T>);
|
||||
_cache._previous = default(ContainerNode<T>);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user