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

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2025-07-16 21:50:20 +0200
committerMartin Hořeňovský2025-07-16 21:50:20 +0200
commit895b8af6bd70b1d56554f34ef55d6de8c306e917 (patch)
tree17acb7dff2cecb3b5ae37cf3083d51ef81406530 /src
parent066f00acf52f38fec7fc411b0b110b28f28a19fe (diff)
downloadcatch3-895b8af6bd70b1d56554f34ef55d6de8c306e917.tar.gz
Avoid needless copy in handling fatal errors
Diffstat (limited to 'src')
-rw-r--r--src/catch2/internal/catch_run_context.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index 4a0be7e3..7025b768 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -484,8 +484,8 @@ namespace Catch {
// Best effort cleanup for sections that have not been destructed yet
// Since this is a fatal error, we have not had and won't have the opportunity to destruct them properly
while (!m_activeSections.empty()) {
- auto nl = m_activeSections.back()->nameAndLocation();
- SectionEndInfo endInfo{ SectionInfo(CATCH_MOVE(nl.location), CATCH_MOVE(nl.name)), {}, 0.0 };
+ auto const& nl = m_activeSections.back()->nameAndLocation();
+ SectionEndInfo endInfo{ SectionInfo(nl.location, nl.name), {}, 0.0 };
sectionEndedEarly(CATCH_MOVE(endInfo));
}
handleUnfinishedSections();