forked from jasder/antlr
IDeque and ArrayDeque to Stack
This commit is contained in:
parent
bbff99c6e1
commit
e2fd234f98
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue