Skip to content

Commit a82b883

Browse files
committed
streamline trait parameters
state asked for a reference, but trajectories for a pointer.
1 parent bca01e8 commit a82b883

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

core/include/moveit/task_constructor/storage.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,14 @@ inline const InterfaceState* state<Interface::BACKWARD>(const SolutionBase& solu
391391

392392
/// Trait to retrieve outgoing (FORWARD) or incoming (BACKWARD) solution segments of a given state
393393
template <Interface::Direction dir>
394-
const InterfaceState::Solutions& trajectories(const InterfaceState* state);
394+
const InterfaceState::Solutions& trajectories(const InterfaceState& state);
395395
template <>
396-
inline const InterfaceState::Solutions& trajectories<Interface::FORWARD>(const InterfaceState* state) {
397-
return state->outgoingTrajectories();
396+
inline const InterfaceState::Solutions& trajectories<Interface::FORWARD>(const InterfaceState& state) {
397+
return state.outgoingTrajectories();
398398
}
399399
template <>
400-
inline const InterfaceState::Solutions& trajectories<Interface::BACKWARD>(const InterfaceState* state) {
401-
return state->incomingTrajectories();
400+
inline const InterfaceState::Solutions& trajectories<Interface::BACKWARD>(const InterfaceState& state) {
401+
return state.incomingTrajectories();
402402
}
403403

404404
/// Trait to retrieve opposite direction (FORWARD <-> BACKWARD)

core/src/container.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ struct SolutionCollector
317317
}
318318

319319
void traverse(const SolutionBase& start, const InterfaceState::Priority& prio) {
320-
const InterfaceState::Solutions& next = trajectories<dir>(state<dir>(start));
320+
const InterfaceState::Solutions& next = trajectories<dir>(*state<dir>(start));
321321
if (next.empty()) { // when reaching the end, add the trace to solutions
322322
assert(prio.depth() == trace.size());
323323
assert(prio.depth() <= max_depth);

core/src/stage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void StagePrivate::setStatus(const InterfaceState* s, InterfaceState::Status sta
166166
status = InterfaceState::DISABLED; // only the first state is marked as FAILED
167167

168168
// traverse solution tree
169-
for (const SolutionBase* successor : trajectories<dir>(s))
169+
for (const SolutionBase* successor : trajectories<dir>(*s))
170170
setStatus<dir>(state<dir>(*successor), status);
171171
}
172172
template void StagePrivate::setStatus<Interface::FORWARD>(const InterfaceState* s, InterfaceState::Status status);

0 commit comments

Comments
 (0)