// Check if the branch already exists
bool found = false;
- auto arIt = this->Get( ).find( a );
- if( arIt != this->Get( ).end( ) )
- found = ( arIt->second.find( b ) != arIt->second.end( ) );
+ auto aIt = this->Get( ).find( a );
+ if( aIt != this->Get( ).end( ) )
+ found = ( aIt->second.find( b ) != aIt->second.end( ) );
if( found )
return;
// Assign path vertices
path->SetReferenceImage( this->m_MinimumSpanningTree );
- this->Get( )[ a ][ b ] = path;
- this->Modified( );
+
+ typedef typename TSkeleton::value_type _T1;
+ typedef typename TSkeletonRow::value_type _T2;
+
+ TSkeleton& sk = this->Get( );
+ auto sIt = sk.find( a );
+ if( sIt == sk.end( ) )
+ {
+ sIt = sk.insert( _T1( a, TSkeletonRow( ) ) ).first;
+ this->Modified( );
+
+ } // fi
+ if( sIt->second.find( b ) == sIt->second.end( ) )
+ {
+ sIt->second.insert( _T2( b, path ) );
+ this->Modified( );
+
+ } // fi
}
// -------------------------------------------------------------------------