mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	Avoid needless copy in handling fatal errors
This commit is contained in:
		@@ -484,8 +484,8 @@ namespace Catch {
 | 
				
			|||||||
        // Best effort cleanup for sections that have not been destructed yet
 | 
					        // 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
 | 
					        // Since this is a fatal error, we have not had and won't have the opportunity to destruct them properly
 | 
				
			||||||
        while (!m_activeSections.empty()) {
 | 
					        while (!m_activeSections.empty()) {
 | 
				
			||||||
            auto nl = m_activeSections.back()->nameAndLocation();
 | 
					            auto const& nl = m_activeSections.back()->nameAndLocation();
 | 
				
			||||||
            SectionEndInfo endInfo{ SectionInfo(CATCH_MOVE(nl.location), CATCH_MOVE(nl.name)), {}, 0.0 };
 | 
					            SectionEndInfo endInfo{ SectionInfo(nl.location, nl.name), {}, 0.0 };
 | 
				
			||||||
            sectionEndedEarly(CATCH_MOVE(endInfo));
 | 
					            sectionEndedEarly(CATCH_MOVE(endInfo));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        handleUnfinishedSections();
 | 
					        handleUnfinishedSections();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user