dependency: No point scanning for circularity on 'add'

This commit is contained in:
Paul Beckingham 2016-02-22 22:52:11 -05:00
parent 774cf3e2d9
commit 0a0793b2ca

View file

@ -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.
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;
s.push (task);
@ -98,6 +103,7 @@ bool dependencyIsCircular (const Task& task)
s.pop ();
}
}
return false;
}