diff options
| author | Martin Hořeňovský | 2023-04-29 14:29:59 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-05-01 13:21:45 +0200 |
| commit | 10f0a5864319c0baa5c4cecb5e6138fd0c78a3e7 (patch) | |
| tree | b8b2383564d6f86b9040df61362b1f87b0f1df45 /src/catch2/catch_test_spec.cpp | |
| parent | fe64c28925d31292516ba0a172870e7deb3baad6 (diff) | |
| download | catch3-10f0a5864319c0baa5c4cecb5e6138fd0c78a3e7.tar.gz | |
Some template instantiation reductions
Diffstat (limited to 'src/catch2/catch_test_spec.cpp')
| -rw-r--r-- | src/catch2/catch_test_spec.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/catch2/catch_test_spec.cpp b/src/catch2/catch_test_spec.cpp index 2a7fd563..99d83792 100644 --- a/src/catch2/catch_test_spec.cpp +++ b/src/catch2/catch_test_spec.cpp @@ -107,16 +107,18 @@ namespace Catch { return std::any_of( m_filters.begin(), m_filters.end(), [&]( Filter const& f ){ return f.matches( testCase ); } ); } - TestSpec::Matches TestSpec::matchesByFilter( std::vector<TestCaseHandle> const& testCases, IConfig const& config ) const - { - Matches matches( m_filters.size() ); - std::transform( m_filters.begin(), m_filters.end(), matches.begin(), [&]( Filter const& filter ){ + TestSpec::Matches TestSpec::matchesByFilter( std::vector<TestCaseHandle> const& testCases, IConfig const& config ) const { + Matches matches; + matches.reserve( m_filters.size() ); + for ( auto const& filter : m_filters ) { std::vector<TestCaseHandle const*> currentMatches; - for( auto const& test : testCases ) - if( isThrowSafe( test, config ) && filter.matches( test.getTestCaseInfo() ) ) + for ( auto const& test : testCases ) + if ( isThrowSafe( test, config ) && + filter.matches( test.getTestCaseInfo() ) ) currentMatches.emplace_back( &test ); - return FilterMatch{ extractFilterName(filter), currentMatches }; - } ); + matches.push_back( + FilterMatch{ extractFilterName( filter ), currentMatches } ); + } return matches; } |