Skip to content

Commit

Permalink
Avoid explicit calls to dict.keys() when iterating
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Oct 23, 2024
1 parent e5ec14f commit c271f01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jaxsim/parsers/rod/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def extract_model_data(
for j in sdf_model.joints()
if j.type == "fixed"
and j.parent == "world"
and j.child in links_dict.keys()
and j.child in links_dict
and j.pose.relative_to in {"__model__", "world", None}
]

Expand Down Expand Up @@ -283,7 +283,7 @@ def extract_model_data(
for j in sdf_model.joints()
if j.type in {"revolute", "continuous", "prismatic", "fixed"}
and j.parent != "world"
and j.child in links_dict.keys()
and j.child in links_dict
]

# Create a dictionary to find the parent joint of the links.
Expand Down

0 comments on commit c271f01

Please sign in to comment.