Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed dependency bug & simplified TaskGraph
Fixes #386. This bug was fixed here as a side-effect of simplifying the implementation of TaskGraph's dependency logic. Previously, dependency relationships of nodes in TaskGraph were updated by adding/removing from the dependencies/dependants arrays of the appropriate TaskNodes when nodes were added or removed. This logic was somewhat opaque and difficult to maintain/debug. Here, we change the implementation to simply rebuild the dependency relationships of all nodes in TaskGraph's index whenever a node is added or removed. With this implementation, we no longer need to track dependants or handle predecessors (since addTaskInternal and processTasksInternal are never mutually concurrent), and the logic is hopefully simpler and easier to maintain.
- Loading branch information