From 200fa982270d24c891b822c1a37237cf9a57b4b1 Mon Sep 17 00:00:00 2001 From: Yihua Liu Date: Sun, 11 Sep 2022 21:29:54 +0800 Subject: [PATCH] remove the duplicate changes from PR #64 --- sootty/storage/wiregroup.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/sootty/storage/wiregroup.py b/sootty/storage/wiregroup.py index 162f890..a82b5f2 100644 --- a/sootty/storage/wiregroup.py +++ b/sootty/storage/wiregroup.py @@ -37,19 +37,12 @@ def find(self, name: str): raise SoottyError(f"Wire '{name}' does not exist.") def get_names(self): - """Returns a dictionary of all wire names of this wiregroup or a list if this wiregroup is the innermost one.""" - if self.groups: - names = dict() - if self.wires: - names[self.name] = list() - for wire in self.wires: - names[self.name].append(wire.name) - for group in self.groups: - names[group.name] = group.get_names() - else: - names = list() - for wire in self.wires: - names.append(wire.name) + """Returns list of all wire names.""" + names = set() + for wire in self.wires: + names.add(wire.name) + for group in self.groups: + names.update(group.get_names()) return names def get_wires(self):