1
0
Fork 0
mirror of https://github.com/Findus23/RPGnotes.git synced 2024-09-18 14:33:44 +02:00

don't add edges to itself

This commit is contained in:
Lukas Winkler 2022-11-25 20:09:35 +01:00
parent 2c6a79edf5
commit 1e940660d3
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -32,9 +32,13 @@ class Graph:
})
def add_edge(self, source: GraphModelEl, target: GraphModelEl):
if source == target:
return
self.edges.add((source.graphkey, target.graphkey))
def add_edge_str(self, source: str, target: str):
if source == target:
return
self.edges.add((source, target))
def prune(self) -> None: