mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-06 23:40:55 +00: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:
parent
83bfae1a50
commit
52cbb507ab
4 changed files with 8 additions and 8 deletions
|
@ -52,7 +52,7 @@ namespace Catch {
|
|||
}
|
||||
|
||||
AssertionHandler::AssertionHandler
|
||||
( StringRef macroName,
|
||||
( StringRef const& macroName,
|
||||
SourceLineInfo const& lineInfo,
|
||||
StringRef capturedExpression,
|
||||
ResultDisposition::Flags resultDisposition )
|
||||
|
@ -109,7 +109,7 @@ namespace Catch {
|
|||
|
||||
// This is the overload that takes a string and infers the Equals matcher from it
|
||||
// The more general overload, that takes any string matcher, is in catch_capture_matchers.cpp
|
||||
void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ) {
|
||||
void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString ) {
|
||||
handleExceptionMatchExpr( handler, Matchers::Equals( str ), matcherString );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue