Skip to content
Snippets Groups Projects
Commit 135a287e authored by Mark Winter's avatar Mark Winter
Browse files

Don't look back past the CSourcePath supported length

parent 26a3f60a
Branches
No related tags found
No related merge requests found
......@@ -100,22 +100,30 @@ inline CSourcePath path_append_front(const CSourcePath& inPath, CellID idx)
CellID bidirDepthFirstSearch(threadDB* thread_db, CSourcePath partialPath, CellID bestLGIdx = CellID(-1))
{
// Get backward-looking edges from start of path
int lEdgeCount = gccInEdges.count(partialPath.peek_front());
int lEdgeCount = 0;
if (partialPath.startIdx > 0)
{
lEdgeCount = gccInEdges.count(partialPath.peek_front());
if (lEdgeCount > 0)
{
for (CellID leftID : gccInEdges[partialPath.peek_front()])
{
bestLGIdx = bidirDepthFirstSearch(thread_db, path_append_back(partialPath, leftID), bestLGIdx);
bestLGIdx = bidirDepthFirstSearch(thread_db, path_append_front(partialPath, leftID), bestLGIdx);
}
}
}
// Get forward-looking edges from end of path
int rEdgeCount = gccOutEdges.count(partialPath.peek_back());
int rEdgeCount = 0;
if (partialPath.endIdx < partialPath.indices.size() - 1)
{
rEdgeCount = gccOutEdges.count(partialPath.peek_back());
if (rEdgeCount > 0)
{
for (CellID rightID : gccOutEdges[partialPath.peek_back()])
{
bestLGIdx = bidirDepthFirstSearch(thread_db, path_append_front(partialPath, rightID), bestLGIdx);
bestLGIdx = bidirDepthFirstSearch(thread_db, path_append_back(partialPath, rightID), bestLGIdx);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment