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:
Martin Hořeňovský
2023-01-28 13:00:30 +01:00
parent d58491c85a
commit 2403f5620e
7 changed files with 24 additions and 21 deletions
@@ -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 )