mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
Recombine both variants of Interface::updatePriority()
As only the InterfaceState* variant is actually called,
we can drop the splitting introduced for performance reasons in
29d1e44c5d
This commit is contained in:
parent
ffb8598363
commit
9d37495c0b
@ -210,8 +210,6 @@ public:
|
|||||||
|
|
||||||
/// update state's priority (and call notify_ if it really has changed)
|
/// update state's priority (and call notify_ if it really has changed)
|
||||||
void updatePriority(InterfaceState* state, const InterfaceState::Priority& priority);
|
void updatePriority(InterfaceState* state, const InterfaceState::Priority& priority);
|
||||||
/// more efficient variant of the above, because we can skip searching the state
|
|
||||||
void updatePriority(Interface::iterator it, const InterfaceState::Priority& priority);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const NotifyFunction notify_;
|
const NotifyFunction notify_;
|
||||||
|
|||||||
@ -142,11 +142,8 @@ void Interface::updatePriority(InterfaceState* state, const InterfaceState::Prio
|
|||||||
|
|
||||||
auto it = std::find(begin(), end(), state); // find iterator to state
|
auto it = std::find(begin(), end(), state); // find iterator to state
|
||||||
assert(it != end()); // state should be part of this interface
|
assert(it != end()); // state should be part of this interface
|
||||||
updatePriority(it, priority);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Interface::updatePriority(Interface::iterator it, const InterfaceState::Priority& priority) {
|
state->priority_ = priority; // update priority
|
||||||
it->priority_ = priority; // update priority
|
|
||||||
update(it); // update position in ordered list
|
update(it); // update position in ordered list
|
||||||
if (notify_)
|
if (notify_)
|
||||||
notify_(it, true); // notify callback
|
notify_(it, true); // notify callback
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user