Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/catch_test_spec.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-09-09 20:15:30 +0200
committerMartin Hořeňovský2026-09-11 11:21:22 +0200
commit5e47f48ecc68ff48c3c085d93502559038141693 (patch)
tree8593f3aaf7cb63cb3bc036012b3891afbe49cca1 /src/catch2/catch_test_spec.cpp
parentab13a28d125b50a458667e972ed56400af7ad931 (diff)
downloadcatch3-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.cpp2
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 {