Skip to content

Commit 482a246

Browse files
committed
fix(graph): make addEdge more forgiving
1 parent 3c11404 commit 482a246

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

utils/Graph/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ class Graph {
1919
const arr = this.AdjList.get(vertex);
2020
if (!arr.includes(node)) {
2121
arr.push(node);
22-
} else {
23-
throw new Error(`Can't add '${node}', it already exists`);
2422
}
2523
} else {
2624
throw new Error(`Can't add non-existing vertex ->'${node}'`);

0 commit comments

Comments
 (0)