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:
Martin Hořeňovský 2023-01-28 10:41:13 +01:00
parent c837cb4a8a
commit d58491c85a
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -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