Working on tree optimizer
This commit is contained in:
@@ -181,9 +181,20 @@ namespace StgSharp.RegularAnalysis.Abstraction
|
||||
_state = 0;
|
||||
}
|
||||
|
||||
public void SkipNode()
|
||||
/// <summary>
|
||||
/// Skips the node and its subtree if the current node is the given node. Otherwise, do
|
||||
/// nothing.
|
||||
/// </summary>
|
||||
/// <param name="node">
|
||||
/// The node to skip.
|
||||
/// </param>
|
||||
public void SkipNode(
|
||||
TNode node
|
||||
)
|
||||
{
|
||||
if (_stack.TryPop(out Record? r)) {
|
||||
if (_stack.TryPeek(out Record? r) && ReferenceEquals(r.Node, node))
|
||||
{
|
||||
_ = _stack.Pop();
|
||||
_recycle.Push(r);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user