forked from catchorg/Catch2
Use StringRef through XmlEncode
This introduces a potential lifetime risk when using the API, but the intended way to use the `XmlEncode` class is to use it directly, e.g. `out << XmlEncode(some-text-argument)`, not to store it around. The benefit is that we avoid allocations for strings that do not fit into SSO for given platform.
This commit is contained in:
@@ -77,7 +77,7 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
XmlEncode::XmlEncode( std::string const& str, ForWhat forWhat )
|
||||
XmlEncode::XmlEncode( StringRef str, ForWhat forWhat )
|
||||
: m_str( str ),
|
||||
m_forWhat( forWhat )
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user