From a0b5b8246d166d73aa1fe1e33a11e101300c74f3 Mon Sep 17 00:00:00 2001 From: Miklos Marton Date: Fri, 3 Jan 2025 16:32:54 +0100 Subject: [PATCH] Cache variable --- src/ServerMainComponent.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ServerMainComponent.cpp b/src/ServerMainComponent.cpp index bcc8160..f3d09cc 100644 --- a/src/ServerMainComponent.cpp +++ b/src/ServerMainComponent.cpp @@ -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(nextWorkingSet->get_working_set_object())->get_active_mask(); + activeWorkingSetDataMaskObjectID = std::static_pointer_cast(nextWorkingSetObject)->get_active_mask(); newWorkingSetFound = true; } else