mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-19 11:25:38 +02:00
Use char literal instead of string literal with 1 char
In reality, this is a relatively small performance improvement, especially with the previous improvements removing lots of superfluous string handling, but still was measurable.
This commit is contained in:
@@ -202,7 +202,7 @@ namespace Matchers {
|
||||
return m_data.m_str == m_data.adjustString( expr );;
|
||||
}
|
||||
virtual std::string toString() const {
|
||||
return "equals: \"" + m_data.m_str + "\"" + m_data.toStringSuffix();
|
||||
return "equals: \"" + m_data.m_str + '"' + m_data.toStringSuffix();
|
||||
}
|
||||
|
||||
CasedString m_data;
|
||||
@@ -219,7 +219,7 @@ namespace Matchers {
|
||||
return m_data.adjustString( expr ).find( m_data.m_str ) != std::string::npos;
|
||||
}
|
||||
virtual std::string toString() const {
|
||||
return "contains: \"" + m_data.m_str + "\"" + m_data.toStringSuffix();
|
||||
return "contains: \"" + m_data.m_str + '"' + m_data.toStringSuffix();
|
||||
}
|
||||
|
||||
CasedString m_data;
|
||||
@@ -237,7 +237,7 @@ namespace Matchers {
|
||||
return startsWith( m_data.adjustString( expr ), m_data.m_str );
|
||||
}
|
||||
virtual std::string toString() const {
|
||||
return "starts with: \"" + m_data.m_str + "\"" + m_data.toStringSuffix();
|
||||
return "starts with: \"" + m_data.m_str + '"' + m_data.toStringSuffix();
|
||||
}
|
||||
|
||||
CasedString m_data;
|
||||
@@ -254,7 +254,7 @@ namespace Matchers {
|
||||
return endsWith( m_data.adjustString( expr ), m_data.m_str );
|
||||
}
|
||||
virtual std::string toString() const {
|
||||
return "ends with: \"" + m_data.m_str + "\"" + m_data.toStringSuffix();
|
||||
return "ends with: \"" + m_data.m_str + '"' + m_data.toStringSuffix();
|
||||
}
|
||||
|
||||
CasedString m_data;
|
||||
|
Reference in New Issue
Block a user