Skip to content

Commit

Permalink
Cache variable
Browse files Browse the repository at this point in the history
  • Loading branch information
martonmiklos authored and GwnDaan committed Jan 7, 2025
1 parent cc02258 commit a0b5b82
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ServerMainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,10 @@ void ServerMainComponent::timerCallback()
if (nextWorkingSet->get_control_function()->get_address() != activeWorkingSetMasterAddress)
{
activeWorkingSetMasterAddress = nextWorkingSet->get_control_function()->get_address();
if (nextWorkingSet->get_working_set_object())
auto nextWorkingSetObject = nextWorkingSet->get_working_set_object();
if (nextWorkingSetObject)
{
activeWorkingSetDataMaskObjectID = std::static_pointer_cast<isobus::WorkingSet>(nextWorkingSet->get_working_set_object())->get_active_mask();
activeWorkingSetDataMaskObjectID = std::static_pointer_cast<isobus::WorkingSet>(nextWorkingSetObject)->get_active_mask();
newWorkingSetFound = true;
}
else
Expand Down

0 comments on commit a0b5b82

Please sign in to comment.