Skip to content
Permalink
Browse files
Reserve
  • Loading branch information
nyalldawson committed Jan 10, 2022
1 parent 687bc99 commit 286f79e5f727c67587e595e4787d120c421a4107
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/core/pal/problem.cpp
@@ -653,6 +653,7 @@ void Problem::chain_search()
QList<LabelPosition *> Problem::getSolution( bool returnInactive, QList<LabelPosition *> *unlabeled )
{
QList<LabelPosition *> finalLabelPlacements;
finalLabelPlacements.reserve( mFeatureCount );

// loop through all features to be labeled
for ( std::size_t i = 0; i < mFeatureCount; i++ )
@@ -684,6 +685,7 @@ QList<LabelPosition *> Problem::getSolution( bool returnInactive, QList<LabelPos
// unlabeled features also include those with no candidates
if ( unlabeled )
{
unlabeled->reserve( mPositionsWithNoCandidates.size() );
for ( const std::unique_ptr< LabelPosition > &position : mPositionsWithNoCandidates )
unlabeled->append( position.get() );
}

0 comments on commit 286f79e

Please sign in to comment.