diff options
| author | Martin Hořeňovský | 2023-01-28 22:01:34 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-01-28 22:14:37 +0100 |
| commit | 906552f8c831d0dd1917484b53dd080537f19acd (patch) | |
| tree | 924f76f3f75e9532b7b5fdabd482c6df11ce946f /src/catch2/interfaces/catch_interfaces_reporter.cpp | |
| parent | 356dfc14391183aef80af7f23fe2297485311ae4 (diff) | |
| download | catch3-906552f8c831d0dd1917484b53dd080537f19acd.tar.gz | |
Clean up extraneous copies in Messages
This removes 109 allocations from running `tests/SelfTest`
(437057 -> 436948).
Diffstat (limited to 'src/catch2/interfaces/catch_interfaces_reporter.cpp')
| -rw-r--r-- | src/catch2/interfaces/catch_interfaces_reporter.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/catch2/interfaces/catch_interfaces_reporter.cpp b/src/catch2/interfaces/catch_interfaces_reporter.cpp index 8c8bac54..e9aff69c 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.cpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp @@ -60,10 +60,9 @@ namespace Catch { // Copy message into messages list. // !TBD This should have been done earlier, somewhere MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() ); - builder << assertionResult.getMessage(); - builder.m_info.message = builder.m_stream.str(); + builder.m_info.message = static_cast<std::string>(assertionResult.getMessage()); - infoMessages.push_back( builder.m_info ); + infoMessages.push_back( CATCH_MOVE(builder.m_info) ); } } |