Skip to content

Commit ad58ba4

Browse files
committed
Fixed bug with selecting connections with a given destination
1 parent c0965fe commit ad58ba4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ Changelog
374374
- Deprecated Port.get_connection_by_dest()
375375
- Added Port.get_connections_by_dest()
376376
- Added Port.get_connections_by_dests()
377+
- Fixed a bug where finding a connection with a given destination would return
378+
all connections on the port.
377379

378380
3.0.1
379381
-----

rtctree/ports.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,13 @@ def get_connections_by_dests(self, dests):
153153
for c in self.connections:
154154
if not c.has_port(self):
155155
continue
156+
has_dest = False
156157
for d in dests:
157-
if not c.has_port(d):
158-
continue
159-
res.append(c)
158+
if c.has_port(d):
159+
has_dest = True
160+
break
161+
if has_dest:
162+
res.append(c)
160163
return res
161164

162165
def get_connection_by_id(self, id):

0 commit comments

Comments
 (0)