mirror of
https://github.com/catchorg/Catch2.git
synced 2025-11-16 10:59:31 +01:00
Make StringRef's operator std::string explicit
This way it is explicit when there is a `StringRef` -> `std::string` conversion and makes it easier to look for allocations that could be avoided. Doing this has already removed one allocation per registered test case, as there was a completely pointless `StringRef` -> `std::string` conversion when parsing tags of a test case.
This commit is contained in:
@@ -9601,28 +9601,6 @@ Message from section two
|
||||
</Section>
|
||||
<OverallResults successes="2" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Section name="to std::string" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Section name="implicitly constructed" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Original>
|
||||
stdStr == "a stringref"
|
||||
</Original>
|
||||
<Expanded>
|
||||
"a stringref" == "a stringref"
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Original>
|
||||
stdStr.size() == sr.size()
|
||||
</Original>
|
||||
<Expanded>
|
||||
11 == 11
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="2" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<OverallResults successes="2" failures="0" expectedFailures="0"/>
|
||||
</Section>
|
||||
<Section name="to std::string" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Section name="explicitly constructed" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" >
|
||||
@@ -14834,7 +14812,7 @@ loose text artifact
|
||||
</Section>
|
||||
<OverallResult success="true"/>
|
||||
</TestCase>
|
||||
<OverallResults successes="1407" failures="149" expectedFailures="21"/>
|
||||
<OverallResults successes="1405" failures="149" expectedFailures="21"/>
|
||||
</Group>
|
||||
<OverallResults successes="1407" failures="148" expectedFailures="21"/>
|
||||
<OverallResults successes="1405" failures="148" expectedFailures="21"/>
|
||||
</Catch>
|
||||
|
||||
Reference in New Issue
Block a user