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

summaryrefslogtreecommitdiffhomepage
path: root/src/Progmasoft/Mock.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-08-24 15:11:44 +0200
committerMartin Hořeňovský2026-08-24 15:11:48 +0200
commitfc5bc1fa8b57326b5bc8eaa189b3534b99913d07 (patch)
treed50b26106d73ffab57ea88a3ef9a43823aee437d /src/Progmasoft/Mock.cpp
parent499442d7ef9242ce1bb329d69ea13ee6d340421c (diff)
downloadcatch3-fc5bc1fa8b57326b5bc8eaa189b3534b99913d07.tar.gz
Improve String matcher handling of case sensitivity
The old implementation of String matchers worked by making a, potentially lower-cased, copy of both the constructor arg, and the arg to `match` calls. The new implementation does not make copies, and instead does per-character lowering if needed. This is a win in **most** cases, with two exceptions: 1) Case-insensitive `Equals` between long strings. The old implementation is easy to autovectorize by the compiler, which wins over the extra copy with sufficiently long inputs. 2) Case-insensitive `ContainsSubstring` with inputs that trigger the worst case complexity of O(m*n) of the naive implementation. The latter is fixable with some elbow grease by implementing a proper string search algorithm, but the former is a cost we have to live with.
Diffstat (limited to 'src/Progmasoft/Mock.cpp')
0 files changed, 0 insertions, 0 deletions