IDeque and ArrayDeque to Stack

This commit is contained in:
Sam Harwell 2013-02-17 20:35:43 -06:00
parent bbff99c6e1
commit e2fd234f98
2 changed files with 5 additions and 5 deletions

View File

@ -793,8 +793,8 @@ nextState_break: ;
return true;
}
BitArray reachable = new BitArray(atn.states.Count);
IDeque<ATNState> worklist = new ArrayDeque<ATNState>();
worklist.AddItem(transition.followState);
Stack<ATNState> worklist = new Stack<ATNState>();
worklist.Push(transition.followState);
while (worklist.Count > 0)
{
ATNState state = worklist.Pop();
@ -818,7 +818,7 @@ nextState_break: ;
{
return false;
}
worklist.AddItem(t.target);
worklist.Push(t.target);
}
}
return true;

View File

@ -231,8 +231,8 @@ namespace Antlr4.Runtime.Atn
private bool Equals(Antlr4.Runtime.Atn.ArrayPredictionContext other, ISet<PredictionContextCache.IdentityCommutativePredictionContextOperands
> visited)
{
IDeque<PredictionContext> selfWorkList = new ArrayDeque<PredictionContext>();
IDeque<PredictionContext> otherWorkList = new ArrayDeque<PredictionContext>();
Stack<PredictionContext> selfWorkList = new Stack<PredictionContext>();
Stack<PredictionContext> otherWorkList = new Stack<PredictionContext>();
selfWorkList.Push(this);
otherWorkList.Push(other);
while (selfWorkList.Count > 0)