File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -794,6 +794,7 @@ inline void Circuit::_Optimize()
794
794
if ( _threadCount != 0 )
795
795
{
796
796
std::vector<std::vector<DSPatch::Component*>> componentsMap;
797
+ componentsMap.reserve ( _components.size () );
797
798
798
799
for ( int i = (int )_components.size () - 1 ; i >= 0 ; --i )
799
800
{
Original file line number Diff line number Diff line change @@ -469,9 +469,10 @@ inline void Component::ScanParallel( std::vector<std::vector<DSPatch::Component*
469
469
}
470
470
471
471
// insert component at _scanPosition
472
- if ( _scanPosition > = (int )componentsMap.size () )
472
+ if ( _scanPosition = = (int )componentsMap.size () )
473
473
{
474
- componentsMap.resize ( _scanPosition + 1 );
474
+ componentsMap.emplace_back ( std::vector<DSPatch::Component*>{} );
475
+ componentsMap[_scanPosition].reserve ( componentsMap.capacity () );
475
476
}
476
477
componentsMap[_scanPosition].emplace_back ( this );
477
478
}
You can’t perform that action at this time.
0 commit comments