mirror of
https://github.com/catchorg/Catch2.git
synced 2025-11-04 22:19:34 +01: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:
@@ -136,7 +136,7 @@ namespace Catch {
|
||||
XmlWriter& startElement( std::string const& name ) {
|
||||
ensureTagClosed();
|
||||
newlineIfNecessary();
|
||||
stream() << m_indent << "<" << name;
|
||||
stream() << m_indent << '<' << name;
|
||||
m_tags.push_back( name );
|
||||
m_indent += " ";
|
||||
m_tagIsOpen = true;
|
||||
@@ -165,12 +165,12 @@ namespace Catch {
|
||||
|
||||
XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ) {
|
||||
if( !name.empty() && !attribute.empty() )
|
||||
stream() << " " << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << "\"";
|
||||
stream() << ' ' << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << '"';
|
||||
return *this;
|
||||
}
|
||||
|
||||
XmlWriter& writeAttribute( std::string const& name, bool attribute ) {
|
||||
stream() << " " << name << "=\"" << ( attribute ? "true" : "false" ) << "\"";
|
||||
stream() << ' ' << name << "=\"" << ( attribute ? "true" : "false" ) << '"';
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace Catch {
|
||||
|
||||
void newlineIfNecessary() {
|
||||
if( m_needsNewline ) {
|
||||
stream() << "\n";
|
||||
stream() << '\n';
|
||||
m_needsNewline = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user