Skip to content

Commit

Permalink
Remove redundant type check
Browse files Browse the repository at this point in the history
  • Loading branch information
martonmiklos authored and ad3154 committed Dec 10, 2024
1 parent 831a240 commit 17dbbda
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/DataMaskRenderAreaComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,13 @@ void DataMaskRenderAreaComponent::mouseUp(const MouseEvent &event)

if (clickedList->get_variable_reference() != isobus::NULL_OBJECT_ID)
{
auto child = clickedList->get_object_by_id(clickedList->get_variable_reference(), parentWorkingSet->get_object_tree());
if (isobus::VirtualTerminalObjectType::NumberVariable == child->get_object_type())
{
auto child = clickedList->get_object_by_id(clickedList->get_variable_reference(), parentWorkingSet->get_object_tree());
auto referencedVariable = clickedList->get_object_by_id(clickedList->get_variable_reference(), parentWorkingSet->get_object_tree());

if (nullptr != child)
if (nullptr != referencedVariable)
{
if (isobus::VirtualTerminalObjectType::NumberVariable == referencedVariable->get_object_type())
{
if (isobus::VirtualTerminalObjectType::NumberVariable == child->get_object_type())
{
selectedIndex = std::static_pointer_cast<isobus::NumberVariable>(child)->get_value();
}
selectedIndex = std::static_pointer_cast<isobus::NumberVariable>(referencedVariable)->get_value();
}
}
}
Expand Down

0 comments on commit 17dbbda

Please sign in to comment.