optimized directed graph with local functions

pull/5/head
Evan Hemsley 2019-06-16 20:12:29 -07:00
parent 810ca03112
commit 8b036bb990
1 changed files with 2 additions and 4 deletions

View File

@ -129,8 +129,7 @@ namespace Encompass
output.Add(vertex, new Dictionary<SearchSymbol, uint>());
}
Action<T> dfsHelper = null;
dfsHelper = (T v) =>
void dfsHelper(T v)
{
discovered.Add(v);
time += 1;
@ -259,8 +258,7 @@ namespace Encompass
public IEnumerable<IEnumerable<T>> SimpleCycles()
{
Action<T, HashSet<T>, Dictionary<T, HashSet<T>>> unblock = null;
unblock = (T thisnode, HashSet<T> blocked, Dictionary<T, HashSet<T>> B) =>
void unblock(T thisnode, HashSet<T> blocked, Dictionary<T, HashSet<T>> B)
{
var stack = new Stack<T>();
stack.Push(thisnode);