mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-17 02:25:38 +02:00
Performance improvement in AssertionInfo.
By using char const * instead of std::string we avoid significant copying per assertion. In a simple loop with 10000000 CHECKS on my system, this reduces the run time from 9.8s to 6s.
This commit is contained in:

committed by
Martin Hořeňovský

parent
017a63da62
commit
dcab8a5971
@@ -40,15 +40,17 @@ namespace Catch {
|
||||
struct AssertionInfo
|
||||
{
|
||||
AssertionInfo() {}
|
||||
AssertionInfo( std::string const& _macroName,
|
||||
AssertionInfo( char const * _macroName,
|
||||
SourceLineInfo const& _lineInfo,
|
||||
std::string const& _capturedExpression,
|
||||
ResultDisposition::Flags _resultDisposition );
|
||||
char const * _capturedExpression,
|
||||
ResultDisposition::Flags _resultDisposition,
|
||||
char const * _secondArg = "");
|
||||
|
||||
std::string macroName;
|
||||
char const * macroName;
|
||||
SourceLineInfo lineInfo;
|
||||
std::string capturedExpression;
|
||||
char const * capturedExpression;
|
||||
ResultDisposition::Flags resultDisposition;
|
||||
char const * secondArg;
|
||||
};
|
||||
|
||||
struct AssertionResultData
|
||||
|
Reference in New Issue
Block a user