Exemplo n.º 1
0
 public void PushAndClear(ref ValueLinkedQueue <T> queue)
 {
     if (queue.IsNotEmpty)
     {
         queue.PeekLast().Next = _first;
         _first = queue.Peek();
         queue.Clear();
     }
 }
Exemplo n.º 2
0
 public void EnqueueAndClear(ref ValueLinkedQueue <T> other)
 {
     if (IsEmpty)
     {
         this = other;
         other.Clear();
     }
     else if (other.IsNotEmpty)
     {
         _last.Next = other._first;
         _last      = other._last;
         other.Clear();
     }
 }