diff options
| author | Martin Hořeňovský | 2018-07-23 13:49:29 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2018-07-23 14:04:43 +0200 |
| commit | 52cbb507abdc039f9a6859781106d8855004666d (patch) | |
| tree | e7b44e86a6d935a07f4e7334da0974d998c447a2 /include/internal/catch_assertionhandler.cpp | |
| parent | 83bfae1a50c0ff0893e809ce287432c1c3d94620 (diff) | |
| download | catch3-52cbb507abdc039f9a6859781106d8855004666d.tar.gz | |
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.
Diffstat (limited to 'include/internal/catch_assertionhandler.cpp')
| -rw-r--r-- | include/internal/catch_assertionhandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/internal/catch_assertionhandler.cpp b/include/internal/catch_assertionhandler.cpp index 28768077..ced52312 100644 --- a/include/internal/catch_assertionhandler.cpp +++ b/include/internal/catch_assertionhandler.cpp @@ -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 ); } |