Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_section.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-01-28 10:41:13 +0100
committerMartin Hořeňovský2023-01-28 12:56:29 +0100
commitd58491c85a534a9348634ac3e4eb384df22f4d71 (patch)
tree21d7391203d8d2db4fd67912d9148de9eef7dae3 /src/catch2/internal/catch_section.cpp
parentc837cb4a8aaa2064f63e67ed0a7f7055dbf159c5 (diff)
downloadcatch3-d58491c85a534a9348634ac3e4eb384df22f4d71.tar.gz
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.
Diffstat (limited to 'src/catch2/internal/catch_section.cpp')
-rw-r--r--src/catch2/internal/catch_section.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/catch2/internal/catch_section.cpp b/src/catch2/internal/catch_section.cpp
index ca2e5d8c..63b4abd3 100644
--- a/src/catch2/internal/catch_section.cpp
+++ b/src/catch2/internal/catch_section.cpp
@@ -25,7 +25,7 @@ namespace Catch {
Section::~Section() {
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() )
getResultCapture().sectionEndedEarly( endInfo );
else