/// <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; }
internal BlockRevQueue.Block NewBlock() { BlockRevQueue.Block b = next; if (b == null) { return(new BlockRevQueue.Block()); } next = b.next; b.Clear(); return(b); }
public override void Add(RevCommit c) { BlockRevQueue.Block b = head; if (b == null || !b.CanUnpop()) { b = free.NewBlock(); b.ResetToEnd(); b.next = head; head = b; } b.Unpop(c); }
internal virtual void RemoveFlag(int f) { int not_f = ~f; for (BlockRevQueue.Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) { b.commits[i].flags &= not_f; } } }
public override string ToString() { StringBuilder s = new StringBuilder(); for (BlockRevQueue.Block q = head; q != null; q = q.next) { for (int i = q.headIndex; i < q.tailIndex; i++) { Describe(s, q.commits[i]); } } return(s.ToString()); }
internal override bool AnybodyHasFlag(int f) { for (BlockRevQueue.Block b = head; b != null; b = b.next) { for (int i = b.headIndex; i < b.tailIndex; i++) { if ((b.commits[i].flags & f) != 0) { return(true); } } } return(false); }
internal override RevCommit Next() { BlockRevQueue.Block b = head; if (b == null) { return(null); } RevCommit c = b.Pop(); if (b.IsEmpty()) { head = b.next; free.FreeBlock(b); } return(c); }
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); }
internal BlockRevQueue.Block NewBlock() { BlockRevQueue.Block b = next; if (b == null) { return new BlockRevQueue.Block(); } next = b.next; b.Clear(); return b; }
internal void FreeBlock(BlockRevQueue.Block b) { b.next = next; next = b; }
internal void Clear() { next = null; }
internal void Clear() { next = null; headIndex = 0; tailIndex = 0; }
public override void Clear() { head = null; free.Clear(); }
internal override RevCommit Next() { BlockRevQueue.Block b = head; if (b == null) { return null; } RevCommit c = b.Pop(); if (b.IsEmpty()) { head = b.next; if (head == null) { tail = null; } free.FreeBlock(b); } return c; }
public override void Clear() { head = null; tail = null; free.Clear(); }