forked from catchorg/Catch2
Avoid copying NameAndLocationRef when passed as argument
`NameAndLocationRef` is pretty large type, so even in release build, it is unlikely to be passed in registers. In addition to the fact that some platforms currently do not allow passing even small types in register (Windows ABI!!), it is better to pass it as a ref, effectively passing around a pointer.
This commit is contained in:
@@ -38,7 +38,7 @@ namespace TestCaseTracking {
|
||||
m_children.push_back( CATCH_MOVE(child) );
|
||||
}
|
||||
|
||||
ITracker* ITracker::findChild( NameAndLocationRef nameAndLocation ) {
|
||||
ITracker* ITracker::findChild( NameAndLocationRef const& nameAndLocation ) {
|
||||
auto it = std::find_if(
|
||||
m_children.begin(),
|
||||
m_children.end(),
|
||||
@@ -177,7 +177,7 @@ namespace TestCaseTracking {
|
||||
|
||||
bool SectionTracker::isSectionTracker() const { return true; }
|
||||
|
||||
SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocationRef nameAndLocation ) {
|
||||
SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocationRef const& nameAndLocation ) {
|
||||
SectionTracker* tracker;
|
||||
|
||||
ITracker& currentTracker = ctx.currentTracker();
|
||||
|
||||
Reference in New Issue
Block a user