Skip to content

Fix remove duplicated vars in xml parsing#1154

Open
doguto wants to merge 1 commit into
BehaviorTree:masterfrom
doguto:fix/remove-duplicated-vars-in-xml-parsing
Open

Fix remove duplicated vars in xml parsing#1154
doguto wants to merge 1 commit into
BehaviorTree:masterfrom
doguto:fix/remove-duplicated-vars-in-xml-parsing

Conversation

@doguto

@doguto doguto commented Jun 19, 2026

Copy link
Copy Markdown

In src/xml_parsing.cpp, XMLParser::PImpl::createNodeFromXML(), port_name and port_value were declared at the outer scope of the attribute-iteration loop, then immediately re-declared with identical values inside the if(IsAllowedPortName(...)) block, shadowing the outer variables.

The inner declarations (lines 809–810) are dead code and have been removed. Behavior is unchanged.

Resolve #1153

Checklist
• No API / ABI / behavioral changes introduced
• No new unit test needed (the change is a pure dead-code removal with no behavioral effect)
• pre-commit applied
• ./run_clang_tidy.sh executed and clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redundant variable declarations (variable shadowing) in createNodeFromXML

1 participant