fix: move format into constructor

This commit is contained in:
Lin, Hung-Shin committed 2023-11-15 14:46:41 +08:00
1 parent e18f0db5ad
commit 14d6ab961b
2 files changed
-9

No files matched your search

-3
View File
@@ -2,9 +2,6 @@ export default class DAG {
constructor(nodes) {
this.nodes = new Map(nodes.map((node) => [node._id, node]))
this.edges = new Set()
}
format() {
this.nodes.forEach((_, id) => {
this.setLayer(id)
this.addEdges(id)