diff options
| author | Martin Hořeňovský | 2026-09-09 20:15:30 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2026-09-11 11:21:22 +0200 |
| commit | 5e47f48ecc68ff48c3c085d93502559038141693 (patch) | |
| tree | 8593f3aaf7cb63cb3bc036012b3891afbe49cca1 /src/catch2/catch_test_spec.cpp | |
| parent | ab13a28d125b50a458667e972ed56400af7ad931 (diff) | |
| download | catch3-5e47f48ecc68ff48c3c085d93502559038141693.tar.gz | |
Avoid per-input alloc+copy in WildcardPattern::matches
The old implementation always forced copy (and likely alloc) for
each input when matching it. The new implementation uses the
case-insensitive comparators to avoid all that.
This provides interesting performance improvement for selecting
individual test, doing something like `./tests/SelfTest "ABC*"`
is almost 10% faster.
Diffstat (limited to 'src/catch2/catch_test_spec.cpp')
| -rw-r--r-- | src/catch2/catch_test_spec.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/catch2/catch_test_spec.cpp b/src/catch2/catch_test_spec.cpp index f7c202df..0b33ecb3 100644 --- a/src/catch2/catch_test_spec.cpp +++ b/src/catch2/catch_test_spec.cpp @@ -32,7 +32,7 @@ namespace Catch { TestSpec::NamePattern::NamePattern( std::string const& name, std::string const& filterString ) : Pattern( filterString ) - , m_wildcardPattern( toLower( name ), CaseSensitive::No ) + , m_wildcardPattern( name, CaseSensitive::No ) {} bool TestSpec::NamePattern::matches( TestCaseInfo const& testCase ) const { |