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:
Martin Hořeňovský 2017-01-29 23:07:15 +01:00
parent efab3ca8b2
commit bcaa2f9646
13 changed files with 72 additions and 72 deletions

View file

@ -30,7 +30,7 @@ namespace Catch {
if( _warning == "NoAssertions" )
config.warnings = static_cast<WarnAbout::What>( config.warnings | WarnAbout::NoAssertions );
else
throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" );
throw std::runtime_error( "Unrecognised warning: '" + _warning + '\'' );
}
inline void setOrder( ConfigData& config, std::string const& order ) {
if( startsWith( "declared", order ) )
@ -40,7 +40,7 @@ namespace Catch {
else if( startsWith( "random", order ) )
config.runOrder = RunTests::InRandomOrder;
else
throw std::runtime_error( "Unrecognised ordering: '" + order + "'" );
throw std::runtime_error( "Unrecognised ordering: '" + order + '\'' );
}
inline void setRngSeed( ConfigData& config, std::string const& seed ) {
if( seed == "time" ) {
@ -88,7 +88,7 @@ namespace Catch {
line = trim(line);
if( !line.empty() && !startsWith( line, '#' ) ) {
if( !startsWith( line, '"' ) )
line = "\"" + line + "\"";
line = '"' + line + '"';
addTestOrTags( config, line + ',' );
}
}