mirror of
https://github.com/catchorg/Catch2.git
synced 2025-10-19 08:35:40 +02:00
Avoid copying StringRef
In theory the copy is cheap (couple of pointers change), but tests are usually compiled in Debug mode/with minimal optimizations, which means that most users will still have to pay the cost for those function calls.
This commit is contained in:
@@ -49,7 +49,7 @@ namespace Catch {
|
||||
|
||||
public:
|
||||
AssertionHandler
|
||||
( StringRef macroName,
|
||||
( StringRef const& macroName,
|
||||
SourceLineInfo const& lineInfo,
|
||||
StringRef capturedExpression,
|
||||
ResultDisposition::Flags resultDisposition );
|
||||
@@ -81,7 +81,7 @@ namespace Catch {
|
||||
auto allowThrows() const -> bool;
|
||||
};
|
||||
|
||||
void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString );
|
||||
void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString );
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
|
Reference in New Issue
Block a user