dependency: No point scanning for circularity on 'add'
This commit is contained in:
@@ -67,7 +67,12 @@ void dependencyGetBlocking (const Task& task, std::vector <Task>& blocking)
|
|||||||
// Returns true if the supplied task adds a cycle to the dependency chain.
|
// Returns true if the supplied task adds a cycle to the dependency chain.
|
||||||
bool dependencyIsCircular (const Task& task)
|
bool dependencyIsCircular (const Task& task)
|
||||||
{
|
{
|
||||||
std::string task_uuid = task.get ("uuid");
|
|
||||||
|
// A new task has no UUID assigned yet, and therefore cannot be part of any
|
||||||
|
// dependency chain.
|
||||||
|
if (task.has ("uuid"))
|
||||||
|
{
|
||||||
|
auto task_uuid = task.get ("uuid");
|
||||||
|
|
||||||
std::stack <Task> s;
|
std::stack <Task> s;
|
||||||
s.push (task);
|
s.push (task);
|
||||||
@@ -98,6 +103,7 @@ bool dependencyIsCircular (const Task& task)
|
|||||||
|
|
||||||
s.pop ();
|
s.pop ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user