示例#1
0
 /// <summary>Insert the commit pointer at the front of the queue.</summary>
 /// <remarks>Insert the commit pointer at the front of the queue.</remarks>
 /// <param name="c">the commit to insert into the queue.</param>
 public virtual void Unpop(RevCommit c)
 {
     BlockRevQueue.Block b = head;
     if (b == null)
     {
         b = free.NewBlock();
         b.ResetToMiddle();
         b.Add(c);
         head = b;
         tail = b;
         return;
     }
     else
     {
         if (b.CanUnpop())
         {
             b.Unpop(c);
             return;
         }
     }
     b = free.NewBlock();
     b.ResetToEnd();
     b.Unpop(c);
     b.next = head;
     head   = b;
 }
示例#2
0
 public override void Add(RevCommit c)
 {
     BlockRevQueue.Block b = tail;
     if (b == null)
     {
         b = free.NewBlock();
         b.Add(c);
         head = b;
         tail = b;
         return;
     }
     else
     {
         if (b.IsFull())
         {
             b         = free.NewBlock();
             tail.next = b;
             tail      = b;
         }
     }
     b.Add(c);
 }