From c271f01289195ac2285d0b1afa6677df14307a51 Mon Sep 17 00:00:00 2001 From: Filippo Luca Ferretti Date: Wed, 23 Oct 2024 17:18:59 +0200 Subject: [PATCH] Avoid explicit calls to `dict.keys()` when iterating --- src/jaxsim/parsers/rod/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jaxsim/parsers/rod/parser.py b/src/jaxsim/parsers/rod/parser.py index c44d97730..96ef1cdb2 100644 --- a/src/jaxsim/parsers/rod/parser.py +++ b/src/jaxsim/parsers/rod/parser.py @@ -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} ] @@ -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.