@@ -534,24 +534,24 @@ void SerialContainer::onNewSolution(const SolutionBase& current) {
534534 SolutionCollector<Interface::BACKWARD> incoming (num_before, current);
535535 SolutionCollector<Interface::FORWARD> outgoing (num_after, current);
536536
537- // collect (and sort) all solutions spanning from start to end of this container
538- ordered<SolutionSequencePtr> sorted;
537+ // collect (and lift) all solutions spanning from start to end of this container
539538 for (auto & in : incoming.solutions ) {
540539 for (auto & out : outgoing.solutions ) {
541540 InterfaceState::Priority prio = in.second + InterfaceState::Priority (1u , current.cost ()) + out.second ;
542541 assert (prio.enabled ());
543542 // found a complete solution path connecting start to end?
544543 if (prio.depth () == children.size ()) {
545- SolutionSequence::container_type solution ;
546- solution .reserve (children.size ());
544+ SolutionSequence::container_type seq ;
545+ seq .reserve (children.size ());
547546 // insert incoming solutions in reverse order
548- solution .insert (solution .end (), in.first .rbegin (), in.first .rend ());
547+ seq .insert (seq .end (), in.first .rbegin (), in.first .rend ());
549548 // insert current solution
550- solution .push_back (¤t);
549+ seq .push_back (¤t);
551550 // insert outgoing solutions in normal order
552- solution.insert (solution.end (), out.first .begin (), out.first .end ());
553- // store solution in sorted list
554- sorted.insert (std::make_shared<SolutionSequence>(std::move (solution), prio.cost (), this ));
551+ seq.insert (seq.end (), out.first .begin (), out.first .end ());
552+ // create SolutionSequence and lift it to external interface
553+ auto solution = std::make_shared<SolutionSequence>(std::move (seq), prio.cost (), this );
554+ impl->liftSolution (solution, solution->internalStart (), solution->internalEnd ());
555555 }
556556 if (prio.depth () > 1 ) {
557557 // update state priorities along the whole partial solution path
@@ -561,10 +561,6 @@ void SerialContainer::onNewSolution(const SolutionBase& current) {
561561 }
562562 }
563563 // printChildrenInterfaces(*this->pimpl(), true, *current.creator());
564-
565- // finally, store + announce new solutions to external interface
566- for (const auto & solution : sorted)
567- impl->liftSolution (solution, solution->internalStart (), solution->internalEnd ());
568564}
569565
570566SerialContainer::SerialContainer (SerialContainerPrivate* impl) : ContainerBase(impl) {}
0 commit comments