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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_clara.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-12-23 16:02:37 +0100
committerMartin Hořeňovský2023-12-26 14:40:45 +0100
commit2295d2c8ccc0dba4b35adb95ef8946a05996df87 (patch)
tree3f52cdf8fbe628f15f654dfcbb79d25c8c43bb3b /src/catch2/internal/catch_clara.cpp
parent2b69a3e2167a7d770bc2c16f4b8138babba3b0ca (diff)
downloadcatch3-2295d2c8ccc0dba4b35adb95ef8946a05996df87.tar.gz
Store Opt/Arg hint and description as StringRef
There is no good reason for these to be std::strings, as these are just (optional) constants for nice user output. This ends up reducing the allocations significantly. When measuring allocations when running no tests, the changes are `tests/SelfTest` 9213 -> 7705 `tests/ExtraTests/NoTests` 3723 -> 2215
Diffstat (limited to 'src/catch2/internal/catch_clara.cpp')
-rw-r--r--src/catch2/internal/catch_clara.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index c9bc7695..4745eb89 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -185,7 +185,7 @@ namespace Catch {
}
if (!m_hint.empty())
oss << " <" << m_hint << '>';
- return { { oss.str(), m_description } };
+ return { { oss.str(), static_cast<std::string>(m_description) } };
}
bool Opt::isMatch(std::string const& optToken) const {