forked from catchorg/Catch2
Move SectionEndInfo into sectionEnded call in SECTION's destructor
When running `./tests/SelfTest -o /dev/null`, this saves 1272 allocations (437439 -> 437167). In general, this saves multiple allocations per end of an entered `SECTION`, if the section name was too long for SSO, because `RunContext::sectionEnded` can then move the section's name further down the callstack.
This commit is contained in:
@@ -67,11 +67,11 @@ namespace Catch {
|
||||
}
|
||||
}
|
||||
|
||||
SectionStats::SectionStats( SectionInfo const& _sectionInfo,
|
||||
SectionStats::SectionStats( SectionInfo&& _sectionInfo,
|
||||
Counts const& _assertions,
|
||||
double _durationInSeconds,
|
||||
bool _missingAssertions )
|
||||
: sectionInfo( _sectionInfo ),
|
||||
: sectionInfo( CATCH_MOVE(_sectionInfo) ),
|
||||
assertions( _assertions ),
|
||||
durationInSeconds( _durationInSeconds ),
|
||||
missingAssertions( _missingAssertions )
|
||||
|
||||
Reference in New Issue
Block a user