diff --git a/core/include/moveit/task_constructor/storage.h b/core/include/moveit/task_constructor/storage.h index 4089bcd0..c91e2441 100644 --- a/core/include/moveit/task_constructor/storage.h +++ b/core/include/moveit/task_constructor/storage.h @@ -156,7 +156,7 @@ public: container_type remove(iterator it); /// update state's priority if new priority is smaller and call notify_ - void updatePriority(InterfaceState &state, const InterfaceState::Priority &priority); + void updatePriority(InterfaceState *state, const InterfaceState::Priority &priority); private: const NotifyFunction notify_; diff --git a/core/src/container.cpp b/core/src/container.cpp index eadfee49..b0c13303 100644 --- a/core/src/container.cpp +++ b/core/src/container.cpp @@ -246,12 +246,12 @@ void updateStateCosts(const SerialContainer::solution_container &partial_solutio // here it suffices to update the start state, because the end state is the start state // of the next solution (they are all connected) InterfaceState* state = const_cast(solution->start()); - if (state->owner()) state->owner()->updatePriority(*state, prio); + if (state->owner()) state->owner()->updatePriority(state, prio); } // finally update the end state of the last solution if (partial_solution_path.empty()) return; InterfaceState* state = const_cast(partial_solution_path.back()->end()); - if (state->owner()) state->owner()->updatePriority(*state, prio); + if (state->owner()) state->owner()->updatePriority(state, prio); } void SerialContainer::onNewSolution(const SolutionBase ¤t) diff --git a/core/src/storage.cpp b/core/src/storage.cpp index 40b5f14f..aacd9959 100644 --- a/core/src/storage.cpp +++ b/core/src/storage.cpp @@ -104,13 +104,13 @@ Interface::container_type Interface::remove(iterator it) return result; } -void Interface::updatePriority(InterfaceState &state, const InterfaceState::Priority& priority) +void Interface::updatePriority(InterfaceState *state, const InterfaceState::Priority& priority) { - if (priority < state.priority()) { - auto it = std::find_if(begin(), end(), [&state](const InterfaceState& other) { return &state == &other; }); + if (priority < state->priority()) { + auto it = std::find_if(begin(), end(), [state](const InterfaceState& other) { return state == &other; }); // state should be part of the interface assert(it != end()); - state.priority_ = priority; + state->priority_ = priority; if (notify_) notify_(it, true); } }