Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Commit

Permalink
Unify duplicated if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
y-okumura-isp committed Jan 13, 2022
1 parent ca27e15 commit 306e332
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/pathnode_vis/pathnode_vis/pubinfo_traverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,16 @@ def solve2(self, pubinfos, tgt_topic, tgt_stamp,
queue.append((tgt_topic, tgt_stamp, root_results))
while len(queue) != 0:
topic, stamp, cresult = queue.popleft()
info = pubinfos.get(topic, stamp)
if info:
cresult.add_data(info)

# NDT-EKF has loop, so stop
if topic in stops:
next_pubinfo = pubinfos.get(topic, stamp)
if next_pubinfo is not None:
cresult.add_data(next_pubinfo)
else:
# print(f"pubinfo of {topic} {stamp} not found")
continue

# get next edges
next_pubinfo = pubinfos.get(topic, stamp)
if not next_pubinfo:
# NDT-EKF has loop, so stop
if topic in stops:
continue

for in_infos in next_pubinfo.in_infos.values():
Expand Down

0 comments on commit 306e332

Please sign in to comment.