App.get_project_refs(): Use a set for deduplication #120
1 changed files with 3 additions and 2 deletions
|
|
@ -590,6 +590,7 @@ class App(Base):
|
|||
if isinstance(keys, str):
|
||||
keys = [keys]
|
||||
ret: list[str] = []
|
||||
seen: set[str] = set()
|
||||
for key in keys:
|
||||
visited: set[str] = set()
|
||||
for name in projects:
|
||||
|
|
@ -597,9 +598,9 @@ class App(Base):
|
|||
self.walk_project_deps(
|
||||
rr, visited, name, sections, key, add_self, scope, names_only
|
||||
)
|
||||
# TODO: this looks like a performance hogger
|
||||
for m in rr:
|
||||
if m not in ret:
|
||||
if m not in seen:
|
||||
seen.add(m)
|
||||
ret.append(m)
|
||||
return ret
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue