Use StringRef for Opt's optNames
Removes another ~70 allocations.
This commit is contained in:
3 files changed
+13
-10
No files matched your search
@@ -25,13 +25,16 @@ namespace {
|
||||
;
|
||||
}
|
||||
|
||||
std::string normaliseOpt( std::string const& optName ) {
|
||||
#ifdef CATCH_PLATFORM_WINDOWS
|
||||
if ( optName[0] == '/' )
|
||||
return "-" + optName.substr( 1 );
|
||||
else
|
||||
Catch::StringRef normaliseOpt( Catch::StringRef optName ) {
|
||||
if ( optName[0] == '-'
|
||||
#if defined(CATCH_PLATFORM_WINDOWS)
|
||||
|| optName[0] == '/'
|
||||
#endif
|
||||
return optName;
|
||||
) {
|
||||
return optName.substr( 1, optName.size() );
|
||||
}
|
||||
|
||||
return optName;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in new issue
Block a user