Avoid needless copy of string in runContext::handleMessage

This commit is contained in:
Martin Hořeňovský committed 2024-09-13 16:39:51 +02:00
1 parent bd70515c08
commit 412cad546a
5 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -632,13 +632,13 @@ namespace Catch {
void RunContext::handleMessage(
AssertionInfo const& info,
ResultWas::OfType resultType,
StringRef message,
std::string&& message,
AssertionReaction& reaction
) {
m_lastAssertionInfo = info;
AssertionResultData data( resultType, LazyExpression( false ) );
data.message = static_cast<std::string>(message);
data.message = CATCH_MOVE( message );
AssertionResult assertionResult{ m_lastAssertionInfo,
CATCH_MOVE( data ) };