mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Take std::string by const-ref where possible
Most places already do, this brings over some forgotten places. Also close #842
This commit is contained in:
@@ -169,7 +169,7 @@ namespace Catch {
|
||||
stream << result.getSourceInfo() << ':';
|
||||
}
|
||||
|
||||
void printResultType( Colour::Code colour, std::string passOrFail ) const {
|
||||
void printResultType( Colour::Code colour, std::string const& passOrFail ) const {
|
||||
if( !passOrFail.empty() ) {
|
||||
{
|
||||
Colour colourGuard( colour );
|
||||
@@ -179,7 +179,7 @@ namespace Catch {
|
||||
}
|
||||
}
|
||||
|
||||
void printIssue( std::string issue ) const {
|
||||
void printIssue( std::string const& issue ) const {
|
||||
stream << ' ' << issue;
|
||||
}
|
||||
|
||||
|
@@ -157,13 +157,13 @@ namespace Catch {
|
||||
stream << result.getSourceInfo() << ":";
|
||||
}
|
||||
|
||||
void printResultType( std::string passOrFail ) const {
|
||||
void printResultType( std::string const& passOrFail ) const {
|
||||
if( !passOrFail.empty() ) {
|
||||
stream << passOrFail << ' ' << counter << " -";
|
||||
}
|
||||
}
|
||||
|
||||
void printIssue( std::string issue ) const {
|
||||
void printIssue( std::string const& issue ) const {
|
||||
stream << " " << issue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user