mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 14:09:33 +01:00 
			
		
		
		
	Move sectionInfo into sectionEndInfo when SECTION ends
When running `./tests/SelfTest -o /dev/null`, this saves 468 allocations (438907 -> 437439). In general, this saves 1 allocation every time an entered `SECTION` ends and the section name was long enough to move out of the SSO buffer.
This commit is contained in:
		@@ -25,7 +25,7 @@ namespace Catch {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    Section::~Section() {
 | 
					    Section::~Section() {
 | 
				
			||||||
        if( m_sectionIncluded ) {
 | 
					        if( m_sectionIncluded ) {
 | 
				
			||||||
            SectionEndInfo endInfo{ m_info, m_assertions, m_timer.getElapsedSeconds() };
 | 
					            SectionEndInfo endInfo{ CATCH_MOVE(m_info), m_assertions, m_timer.getElapsedSeconds() };
 | 
				
			||||||
            if( uncaught_exceptions() )
 | 
					            if( uncaught_exceptions() )
 | 
				
			||||||
                getResultCapture().sectionEndedEarly( endInfo );
 | 
					                getResultCapture().sectionEndedEarly( endInfo );
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user